Don't allow to show the window menu

This commit is contained in:
Elias Naur 2003-02-12 12:07:50 +00:00
parent a36f15cc0e
commit dcaaccc138
1 changed files with 31 additions and 31 deletions

View File

@ -148,36 +148,42 @@ LRESULT CALLBACK WindowProc(HWND hWnd,
case SC_SCREENSAVE: case SC_SCREENSAVE:
case SC_MONITORPOWER: case SC_MONITORPOWER:
return 0L; return 0L;
case SC_MINIMIZE:
isMinimized = true;
appActivate(true);
break; break;
case SC_MINIMIZE: case SC_RESTORE:
isMinimized = true; isMinimized = false;
appActivate(true); appActivate(false);
break; break;
case SC_RESTORE: case SC_CLOSE:
isMinimized = false; environment->SetStaticBooleanField(clsDisplay, fidclose, true);
appActivate(false); //don't continue processing this command since this
break; //would shutdown the window, which the application might not want to
case SC_CLOSE: return 0L;
environment->SetStaticBooleanField(clsDisplay, fidclose, true);
//don't continue processing this command since this
//would shutdown the window, which the application might not want to
return 0L;
default: default:
break; return 0L; // don't allow the window menu to show
} }
} }
break;
case WM_ACTIVATE: case WM_ACTIVATE:
{ {
switch(LOWORD(wParam)) { switch(LOWORD(wParam)) {
case WA_ACTIVE: case WA_ACTIVE:
case WA_CLICKACTIVE: case WA_CLICKACTIVE:
isMinimized = false; isMinimized = false;
break; break;
case WA_INACTIVE: case WA_INACTIVE:
isMinimized = true; isMinimized = true;
break; break;
} }
appActivate(!isMinimized); appActivate(!isMinimized);
}
break;
case WM_QUIT:
{
environment->SetStaticBooleanField(clsDisplay, fidclose, true);
return 0L;
} }
} }
@ -201,15 +207,9 @@ void handleMessages()
hwnd, // handle to window hwnd, // handle to window
0, // first message 0, // first message
0, // last message 0, // last message
PM_NOREMOVE // removal options PM_REMOVE // removal options
)) { )) {
if (GetMessage (&msg, NULL, 0, 0) <= 0) {
#ifdef _DEBUG
printf("We should quit here...\n");
#endif
return;
}
TranslateMessage(&msg); TranslateMessage(&msg);
DispatchMessage(&msg); DispatchMessage(&msg);
}; };