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,11 +121,19 @@ 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)
{
if (bRet == -1) // error
{
quitModule(NULL);
break;
}
else
{ {
TranslateMessage(&msg); TranslateMessage(&msg);
DispatchMessage(&msg); DispatchMessage(&msg);
} }
}
if (hMutex) ReleaseMutex(hMutex); if (hMutex) ReleaseMutex(hMutex);
return (int)msg.wParam; return (int)msg.wParam;