Update desktop "show window contents while dragging" setting programatically - windows

One of my programs seems to be changing the Display Properties > Appearance > Effects > Show window contents while dragging setting to off every few hours.
I'm not sure exactly which program, or when it happens. I have a number of programs that seem like likely culprits - wallpaper rotators, software for multiple monitors, multiple virual desktops and switching, and a few others.
I am just thinking to create a little batch script to run periodically and set the setting back to on.
Does anyone know how to do this in windows? I'm using xp pro sp3.
Thanks!

The best option is to do this programmatically using the supported API. i haven't tested this, but it should do the trick:
SystemParametersInfo(SPI_SETDRAGFULLWINDOWS,
TRUE,
NULL,
SPIF_UPDATEINIFILE | SPIF_SENDCHANGE)
You can use SPI_GETDRAGFULLWINDOWS to see if the the bit has been flipped to avoid unnecessarily triggering a WM_SETTINGCHANGE.

You can use RegMon to find the program that keeps changing your settings. Maybe that's a better start than hacking around it.

There is a simple and effective solution to this problem. In Notepad type the following lines :
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Control Panel\Desktop] "DragFullWindows"="1"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DragFullWindows] "CheckedValue"=dword:00000001 "UncheckedValue"=dword:00000001
Save the file as "Show Window Contents.reg" Double clicking this file and restarting will cure the problem permanently. Post a message if you find this useful.
Aravind Banerjee

It seems the registry setting which controls that preference is HKCU\Control Panel\Desktop\DragFullWindows. You can read more about it here. However, trying it on my own computer does not register the change right away, so a batch script won't do it. You'll probably have to write a program to manipulate it using SystemParametersInfo(). You can pass it the SPI_SETDRAGFULLWINDOWS parameter. Here's a page explaining it more. Here's a page showing how to call it, albeit not for the same parameter.

I suspect it's kept in the registry - maybe [HKEY_CURRENT_USER\Control Panel\Desktop] - "DragFullWindows"?
It would be easy to flip the registry setting back to "1" every hour or so with a batch file.

Related

Automate changing Windows 10 scaling?

I am trying to automate the process of changing the user's Windows scaling to 100% (right click desktop --> Display settings). As of right now I have a batch script using SendKeys to do everything then close out of settings.
I have tried writing a PS script to change LogPixels but having to sign out every time for changes to take affect is something I'd like to avoid.
Any other way you can think of accomplishing this besides the batch script? Is there a way to alter LogPixels and have it take affect with signing the user out?
In short, you can't do this via the registry method and not need to log in and out.
If you want to look at C# for this, there's a very through answer here:
How can I change Windows 10 Display Scaling Programmatically using C#

How to change default Terminal in Source Tree on windows

I am working on Windows 7 with Source Tree. Because I don't like the default cmd.exe I want to change it to Console2 such that Source Tree will open Command2 instead of Cmd as terminal.
It appears you can't do it, at least in any obvious way. There are a couple of solutions/workarounds that you can use here:
Pick a different favorite terminal. ConEmu is a wrapper for CMD.exe that will act as your default terminal if you tell it to [I thought Console2 could do this as well]. Also - forgive the editorial - ConEmu is way, way, better than Console2.
You can add a custom action in the menu. From the global options go to Custom Actions tab and add an action to Open in Terminal using the console you want. This isn't quite as cool as just hitting the terminal icon, but you can easily accomplish the same outcome.
Unfortunately, these are the best there are for now.
Note: Based upon the link that #sendmoreinfo posted, waiting for Atlassian to add this by default may be better way to go for your purposes. Only problem with that may be is that according to some the newest updates to Source tree are terrible, so I haven't updated as of yet.
Note 2: Though this won't do what you want, there is an Option in the settings under the Git Tab that allows you to Set Git Bash as default prompt. That may or may not get you closer to where you want to be.
You may add Windows Terminal as Custom Action. You may run custom action in context of selected file. Define a new custom action as shown below.

Revert shell without using explorer

I've been playing around with a Windows 7 virtual machine and found that by changing the shell registry value in HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\shell I can use an arbitrary program (for example, paint) as the shell instead of explorer.
Now, given that I have no access to the tools afforded by explorer, how would I go about reverting this? This seems like a rather useful trick for demo machines and such, so I would hope that there's a way to revert them when done.
It turns out that keyboard commands (C-S-ESC, C-M-DEL) still work. Surprisingly, windows-r doesn't work. To revert it, open the task manager using C-S-ESC, then click new task, then you can either run explorer to start the gui shell, or regedit to change the default shell.

Windows internet shortcuts: starting with IE maximized?

I have an internet shortcut on my desktop, with the contents looking like this:
[InternetShortcut]
URL=http://www.microsoft.com/isapi/redir.dll?prd=ie&pver=6&ar=IStart
Modified=D03458CE7738C801A2
I was wondering if there are any tweaks I can do to guarantee that the browser starts maximized after someone loads the link.
Thanks!
In short:You can't guarantee that the browser starts maximized from one special internet link. Either all or none internet links start maximized.
But: Someone had a similar problem than this.
Check this, if it helps you.
Edit: owhowho I've found something really dirty, I think you shouldn't use this, but... here it is. Replace your second line with the following:
URL=javascript:window.moveTo(0,0);window.resizeTo(screen.width,screen.height);window.location.href="http://www.microsoft.com/isapi/redir.dll?prd=ie&pver=6&ar=IStart";
It doesn't make the window really maximized, but makes the browserwindow the maximum height and width.
Rather than using a internet shortcut (.url), create a shortcut (.lnk) to internet explorer. (iexplore.exe) You can set the initial windows state in lnk file. (Right-click the icon and see properties.)
You can give an URL as an argument. The target would be something like
"%programfiles%\Internet Explorer\iexplore.exe" http://reddit.com
This is okay when you are using this only in your computer. This is not a general solution. If you want to do this programatically, there are some windows API's related to creating a shortcut. You will also have to get an path of internet explorer from the registry, as it can vary. Some users might not have IE.
I think IE remembers how it was opened last time and then uses those settings.
You might find this info from Registry and use it, but I doubpt that it was implemented to get the values from startup arguments
You're jumping quite quickly to conclusions here. I don't think you can even guarantee that Internet Explorer will start at all; you will get whatever the user set as his default browser.
i think that it is a guarantee that the internet explorer will start unless the system is down. even if one gets the default window, from there it is very easy for you to set the browser to what you want.

Is there any way to configure windows to not change the focus?

I'm tired of being in the middle of typing something, having a pop-up with a question appear, and hitting enter before reading it... (it also happens with some windows that are not pop-ups)
Do you know if there's some setting I could touch for this not to happen?
It suppose to be a registry change that helps with this type of situations (mentioned in this Coding Horror post about the subject of "focus stealing"). I try it, it doesn't work with all popups but helps with some of them, causing the offending application to flash in the taskbar instead of gain focus.
Not that I know of. This has been a plague of Windows versions for quite some time.
Actually Windows XP tries to avoid that. Of course some programs found a way to circumvented that. Microsoft Powertoy TweakUI has a way to turn the option on again in case it was turned off. You could also edit the registry yourself using the following information.

Resources