I run a script at startup to prevent apps from stealing window focus. Actually, I use Microsoft's TweakUI powertoy, but it gets overridden by another application that runs after it does. My script is an attempt to change things back to what TweakUI set.
The registry change is successful, but it doesn't appear to do anything. Window focus still gets changed until I change the setting again via TweakUI.
Is there some kind of process for making my change active once the edit has been completed?
Code:
Option Explicit
Dim objShell
Set objShell = WScript.CreateObject("WScript.shell")
objShell.RegWrite "HKEY_CURRENT_USER\Control Panel\Desktop\ForegroundLockTimeout", 200000, "REG_DWORD"
The registry change is successful, but it doesn't appear to do anything. Window focus still gets changed until I change the setting again via TweakUI.
Is there some kind of process for making my change active once the edit has been completed?