From 0e7dd6d4ff3c7510a147ba68f43040828dcf486f Mon Sep 17 00:00:00 2001 From: pavelxdd Date: Fri, 16 Dec 2016 18:53:09 +0300 Subject: win32: fix for wm_syscommand According to MSDN, in WM_SYSCOMMAND messages, the four low-order bits of the wParam parameter are used internally by the system. To obtain the correct result when testing the value of wParam, an application must combine the value 0xFFF0 with the wParam value by using the bitwise AND operator. --- video/out/w32_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'video/out/w32_common.c') diff --git a/video/out/w32_common.c b/video/out/w32_common.c index 0de9148257..dad9b10799 100644 --- a/video/out/w32_common.c +++ b/video/out/w32_common.c @@ -786,7 +786,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, PostQuitMessage(0); break; case WM_SYSCOMMAND: - switch (wParam) { + switch (wParam & 0xFFF0) { case SC_SCREENSAVE: case SC_MONITORPOWER: if (w32->disable_screensaver) { -- cgit v1.2.3