Build. Hack. Play. It's just what we do.

I came up with an ahk script that puts an end to one of those little annoyances that add up over time. When I open a Windows system-related panel, such as the one for drive properties, the panel will appear, wherever, on-screen. You can't know where Windows will put it when you launch such a thing. More to the point, you won't get Windows to (remember) where the panel was, the last time you opened it.

I prefer all such elements to come up at center screen. Partly it's a liking for symetry, mostly it's a need for panels/dialogs to show up exactly where I have my eyes focused at the moment.

In the example, ctrl+shift+G launches system drive properties and centers it at the same time. The sleep timer is needed, else the centering action may not occur at all, at least not the first time the script is run. A higher number is guaranteed to work, but it might make the process seem awkward and (jarringly jerky?) to the eyes. If the number is too low, e.g. a value of 100 or less, the second part of the script may be ignored.

Hope you like.

EnvGet A_SystemDrive, SystemDrive
Run, properties %A_SystemDrive%

sleep 150
WinGetPos,,,WinWidth, WinHeight, A
WinMove, A,,% A_ScreenWidth/2 - WinWidth/2,% A_ScreenHeight/2 - WinHeight/2



Share This Story

Get our newsletter