Как глобально отлавливать щелчок мыши?
Нужно чтобы с помощью winapi отлавливался щелчок мыши абсолютно везде,в любом окне.Я пишу но ничего не происходит:
int APIENTRY wWinMain(
_In_ HINSTANCE hInstance,
_In_opt_ HINSTANCE hPrevInstance,
_In_ LPWSTR lpCmdLine,
_In_ int nCmdShow)
{
MSG msg;
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
LRESULT CALLBACK WndProc(HWND hWnd, UINT
message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_LBUTTONDOWN:
MessageBox(NULL, L"Console allocation
failed", L"Error Win32 Api", MB_OK |
MB_ICONINFORMATION);
}
return 0;
}