This commit is contained in:
spx 2010-09-10 19:39:54 +00:00
parent eee8d9bb1c
commit 3afada92ed

View File

@ -66,6 +66,7 @@ int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmd
{ {
HANDLE hMutex = NULL; HANDLE hMutex = NULL;
MSG msg; MSG msg;
BOOL bRet;
HWND hWnd; HWND hWnd;
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
@ -120,10 +121,18 @@ int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmd
initModuleEx(hWnd, module, NULL); initModuleEx(hWnd, module, NULL);
// Run the standard window message loop // Run the standard window message loop
while(GetMessage(&msg, NULL, 0, 0)) while ((bRet = GetMessage(&msg, NULL, 0, 0)) != 0)
{ {
TranslateMessage(&msg); if (bRet == -1) // error
DispatchMessage(&msg); {
quitModule(NULL);
break;
}
else
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
} }
if (hMutex) ReleaseMutex(hMutex); if (hMutex) ReleaseMutex(hMutex);