Updated Freeze to be multi monitor friendly
parent
0f334cc040
commit
3b587d022a
|
@ -108,8 +108,16 @@ void ThawWindowPosF(HWND hwnd, const char *subKey, const char *name)
|
||||||
if(v)
|
if(v)
|
||||||
ShowWindow(hwnd, SW_MAXIMIZE);
|
ShowWindow(hwnd, SW_MAXIMIZE);
|
||||||
|
|
||||||
|
|
||||||
|
HMONITOR hMonitor;
|
||||||
|
MONITORINFO mi;
|
||||||
RECT dr;
|
RECT dr;
|
||||||
GetWindowRect(GetDesktopWindow(), &dr);
|
|
||||||
|
hMonitor = MonitorFromRect(&r, MONITOR_DEFAULTTONEAREST);
|
||||||
|
|
||||||
|
mi.cbSize = sizeof(mi);
|
||||||
|
GetMonitorInfo(hMonitor, &mi);
|
||||||
|
dr = mi.rcMonitor;
|
||||||
|
|
||||||
// If it somehow ended up off-screen, then put it back.
|
// If it somehow ended up off-screen, then put it back.
|
||||||
Clamp(&(r.left), dr.left, dr.right);
|
Clamp(&(r.left), dr.left, dr.right);
|
||||||
|
|
Loading…
Reference in New Issue