mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Fixed the message loop to valid code. (http://msdn.microsoft.com/en-us/library/ms644936.aspx)
This commit is contained in:
parent
eee8d9bb1c
commit
3afada92ed
@ -66,6 +66,7 @@ int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmd
|
||||
{
|
||||
HANDLE hMutex = NULL;
|
||||
MSG msg;
|
||||
BOOL bRet;
|
||||
HWND hWnd;
|
||||
|
||||
_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);
|
||||
|
||||
// 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);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
}
|
||||
|
||||
if (hMutex) ReleaseMutex(hMutex);
|
||||
return (int)msg.wParam;
|
||||
|
Loading…
Reference in New Issue
Block a user