Skip to content

Instantly share code, notes, and snippets.

@neslekkim
Last active November 14, 2023 21:16
Show Gist options
  • Save neslekkim/29eb42acfaa852b390f9 to your computer and use it in GitHub Desktop.
Save neslekkim/29eb42acfaa852b390f9 to your computer and use it in GitHub Desktop.
When all Windows are resized after your monitor have been power-recycled
Some monitors (especially hdmi/TV monitors) don't keep the hdmi port "alive" when they are powered down.
As a result, when windows reboots or comes out of sleep, it can't detect a monitor, so it sets resolution to it's "SIMULATED" monitor registry entry in the key at;
HKLM\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\Configuration
This can be manually edited to contain the actual screen registration of your default monitor.
Change these keys:
Under each is a tree called "00" two of the keys are
PrimSurfSize.cx
PrimSurfSize.cy
Under "00" was another branch also called "00" two of the keys are;
ActiveSize.cx
ActiveSize.cy
On my 4k Monitor, I still have some resize/reposition issues, but not as bad as before registry hacking.
reference:
https://answers.microsoft.com/en-us/windows/forum/windows_7-hardware/windows-7-movesresizes-windows-on-monitor-power/1653aafb-848b-464a-8c69-1a68fbd106aa
http://social.technet.microsoft.com/Forums/windows/en-US/4d8f3aef-8c04-481b-a69a-ec0fbf3669c2/turning-off-display-resizes-open-windows
https://superuser.com/questions/267086/how-to-stop-windows-resizing-when-the-monitor-display-channel-is-turned-off-sw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment