*\r
\*---------------------------------------------------------------------------*/\r
\r
+static void HandleMessage P((MSG *message));\r
+static HANDLE hAccelMain, hAccelNoAlt, hAccelNoICS;\r
+\r
int APIENTRY\r
WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,\r
LPSTR lpCmdLine, int nCmdShow)\r
{\r
MSG msg;\r
- HANDLE hAccelMain, hAccelNoAlt, hAccelNoICS;\r
// INITCOMMONCONTROLSEX ex;\r
\r
debugFP = stderr;\r
0, /* lowest message to examine */\r
0)) /* highest message to examine */\r
{\r
+ HandleMessage(msg);\r
+ }\r
+\r
+\r
+ return (msg.wParam); /* Returns the value from PostQuitMessage */\r
+}\r
+\r
+static void\r
+HandleMessage (MSG *message)\r
+{\r
+ MSG msg = *message;\r
\r
if(msg.message == WM_CHAR && msg.wParam == '\t') {\r
// [HGM] navigate: switch between all windows with tab\r
if(currentElement < 5 && IsIconic(hwndMain)) ShowWindow(hwndMain, SW_RESTORE); // all open together\r
SetFocus(h);\r
\r
- continue; // this message now has been processed\r
+ return; // this message now has been processed\r
}\r
}\r
\r
if(chatHandle[i] && IsDialogMessage(chatHandle[i], &msg)) {\r
done = 1; break;\r
}\r
- if(done) continue; // [HGM] chat: end patch\r
+ if(done) return; // [HGM] chat: end patch\r
TranslateMessage(&msg); /* Translates virtual key codes */\r
DispatchMessage(&msg); /* Dispatches message to window */\r
}\r
- }\r
-\r
+}\r
\r
- return (msg.wParam); /* Returns the value from PostQuitMessage */\r
+void\r
+DoEvents ()\r
+{ /* Dispatch pending messages */\r
+ MSG msg;\r
+ while (PeekMessage(&msg, /* message structure */\r
+ NULL, /* handle of window receiving the message */\r
+ 0, /* lowest message to examine */\r
+ 0, /* highest message to examine */\r
+ PM_REMOVE))\r
+ {\r
+ HandleMessage(msg);\r
+ }\r
}\r
\r
/*---------------------------------------------------------------------------*\\r