mac10
2010-06-07 14:02:24 UTC
I successfully use
SetWindowsHookEx(WH_MOUSE,MouseProc_,0,GetCurrentThreadId());
to set a hook for mouse messages in my application.
In the handler function I react on the WM_MOUSEWHEEL message and work with
the mouseData member to determine the wheel delta etc.
...
MOUSEHOOKSTRUCTEX* pdata = (MOUSEHOOKSTRUCTEX*)lParam;
if (wParam == WM_MOUSEWHEEL) {
WORD h = HIWORD(pdata->mouseData);
WORD l = LOWORD(pdata->mouseData);
}
...
My application is 32 Bit.
This code works flawlessy under 32-Bit Windows versions, but fails under
Windows 7 64-Bit.
The data in the pdata->mouseData member appears to be rubbish, it contains
no valid wheel delta values or flags at all.
This looks like a bug in Windows to me, most likely in the WoW64 which
marshalls the hook from 64 to 32 bit..
Any ideas how to get this working or fixed?
SetWindowsHookEx(WH_MOUSE,MouseProc_,0,GetCurrentThreadId());
to set a hook for mouse messages in my application.
In the handler function I react on the WM_MOUSEWHEEL message and work with
the mouseData member to determine the wheel delta etc.
...
MOUSEHOOKSTRUCTEX* pdata = (MOUSEHOOKSTRUCTEX*)lParam;
if (wParam == WM_MOUSEWHEEL) {
WORD h = HIWORD(pdata->mouseData);
WORD l = LOWORD(pdata->mouseData);
}
...
My application is 32 Bit.
This code works flawlessy under 32-Bit Windows versions, but fails under
Windows 7 64-Bit.
The data in the pdata->mouseData member appears to be rubbish, it contains
no valid wheel delta values or flags at all.
This looks like a bug in Windows to me, most likely in the WoW64 which
marshalls the hook from 64 to 32 bit..
Any ideas how to get this working or fixed?