namazso / SecureUxTheme

🎨 A secure boot compatible in-memory UxTheme patcher
Other
2.19k stars 196 forks source link

Set MainDialog position to be centered on the screen #131

Closed ItsProfessional closed 1 year ago

ItsProfessional commented 1 year ago

Shows the window (MainDialog) at the center of the screen, instead of the top left position which it uses by default.

namazso commented 1 year ago

This will always move the window to the center of the rectangle bounding all displayable area. Even if this causes no major problems (people rarely have holes in the middle of their screen configuration), it might move a window to a different monitor, or put it off-center.

The correct way to do this is MonitorFromWindow -> GetMonitorInfoW to get where the current monitor is and center it there.

ItsProfessional commented 1 year ago

I have updated the code