Replced some SendMessageW to PostMessageW.

This commit is contained in:
2022-02-25 18:15:10 +03:00
parent 73b91259c8
commit 52364a228a

View File

@@ -203,7 +203,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{ {
diag_log(L"Loading context menu failed!"); diag_log(L"Loading context menu failed!");
ShowError(IDS_ERR_MENU); ShowError(IDS_ERR_MENU);
SendMessageW(hWnd, WM_CLOSE, NULL, NULL); PostMessageW(hWnd, WM_CLOSE, NULL, NULL);
} }
diag_log(L"Context menu successfully loaded"); diag_log(L"Context menu successfully loaded");
@@ -212,7 +212,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{ {
diag_log(L"Creating popup menu failed!"); diag_log(L"Creating popup menu failed!");
ShowError(IDS_ERR_POPUP); ShowError(IDS_ERR_POPUP);
SendMessageW(hWnd, WM_CLOSE, NULL, NULL); PostMessageW(hWnd, WM_CLOSE, NULL, NULL);
} }
diag_log(L"Popup menu successfully created"); diag_log(L"Popup menu successfully created");
@@ -238,7 +238,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{ {
diag_log(L"Creating mouse hook failed!"); diag_log(L"Creating mouse hook failed!");
ShowError(IDS_ERR_HOOK); ShowError(IDS_ERR_HOOK);
SendMessageW(hWnd, WM_CLOSE, NULL, NULL); PostMessageW(hWnd, WM_CLOSE, NULL, NULL);
} }
diag_log(L"Mouse hook was successfully set"); diag_log(L"Mouse hook was successfully set");
@@ -247,7 +247,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{ {
diag_log(L"Creating keyboard hook failed!"); diag_log(L"Creating keyboard hook failed!");
ShowError(IDS_ERR_HOOK); ShowError(IDS_ERR_HOOK);
SendMessageW(hWnd, WM_CLOSE, NULL, NULL); PostMessageW(hWnd, WM_CLOSE, NULL, NULL);
} }
diag_log(L"Keyboard hook was successfully set"); diag_log(L"Keyboard hook was successfully set");
@@ -282,7 +282,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
DialogBoxW(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, (DLGPROC)About); DialogBoxW(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, (DLGPROC)About);
bKPressed = FALSE; bKPressed = FALSE;
} }
if (ID_POPUPMENU_EXIT == idMenu) SendMessageW(hWnd, WM_CLOSE, NULL, NULL); if (ID_POPUPMENU_EXIT == idMenu) PostMessageW(hWnd, WM_CLOSE, NULL, NULL);
} }
break; break;
} }