Fixed minimize bug with always on top enabled

This commit is contained in:
pagefault
2001-05-07 21:56:13 +00:00
parent ab4f2683be
commit e40dc93868

View File

@@ -207,11 +207,15 @@ extern "C" void CheckAlwaysOnTop()
else SetWindowPos(hMainWindow, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); else SetWindowPos(hMainWindow, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
} }
BOOL IsMinimized = FALSE;
extern "C" void MinimizeWindow() extern "C" void MinimizeWindow()
{ {
if (AlwaysOnTop == 1) SetWindowPos(hMainWindow, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
MoveWindow(hMainWindow, 0, 0, 0, 0, TRUE); MoveWindow(hMainWindow, 0, 0, 0, 0, TRUE);
InputDeAcquire(); InputDeAcquire();
SetActiveWindow(0); SetActiveWindow(0);
IsMinimized = TRUE;
} }
BOOL InputRead(void) BOOL InputRead(void)
@@ -417,8 +421,8 @@ LRESULT CALLBACK Main_Proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_PAINT: case WM_PAINT:
ValidateRect(hWnd,NULL); ValidateRect(hWnd,NULL);
break; break;
case WM_ACTIVATE: case WM_ACTIVATE:
if(LOWORD(wParam)==WA_INACTIVE) if(LOWORD(wParam)==WA_INACTIVE)
{ {
ChangeDisplaySettings(NULL,0); ChangeDisplaySettings(NULL,0);
} }
@@ -430,6 +434,7 @@ LRESULT CALLBACK Main_Proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
} }
initwinvideo(); initwinvideo();
} }
if (IsMinimized == TRUE && AlwaysOnTop == 1) CheckAlwaysOnTop();
InputAcquire(); InputAcquire();
break; break;
case WM_SETFOCUS: case WM_SETFOCUS: