Hello...
I'm trying use SetWindowsHookEx() in windows 9x/ME/NT4.
Somebody know?
Obrigado...
Printable View
Hello...
I'm trying use SetWindowsHookEx() in windows 9x/ME/NT4.
Somebody know?
Obrigado...
Use it for what?
I use with KeyboardProc (WH_KEYBOARD) and MessageProc (WH_MSGFILTER).
...
And your question is that you don't know how to do what you want to do with the function?
I want make this...
What are you having problems with? You need to narrow your question down.
I'm making thus:
In this way not function for windows 9x/ME/NT4.Code:/* Global Variables */
HHOOK hMsgFilter;
HWND ToolBar;
/* ... */
LRESULT CALLBACK MessageProc(int Code, WPARAM wParam, LPARAM lParam)
{
RECT rc;
MSG *msg;
long x, y;
if(Code < 0)
{
return CallNextHookEx(hMsgFilter, Code, wParam, lParam);
}
msg = (MSG*)lParam;
if(Code == MSGF_MENU)
{
GetWindowRect(ToolBar,&rc);
if(msg->message == WM_MOUSEMOVE)
{
x = LOWORD(msg->lParam); y = HIWORD(msg->lParam);
x -= rc.left; y -= rc.top;
SendMessage(ToolBar,WM_MOUSEMOVE,msg->wParam,MAKELPARAM(x,y));
}
}
return CallNextHookEx(hMsgFilter,Code,wParam,lParam);
}
/* ... */
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
hMsgFilter = SetWindowsHookEx(WH_MSGFILTER,(HOOKPROC)MessageProc,GetModuleHandle(NULL),0);
switch (msg)
{
case WM_DESTROY:
{
UnhookWindowsHookEx(hMsgFilter);
PostQuitMessage(0);
}break;
default:
return DefWindowProc(hwnd, msg, wParam, lParam);
}
return 0;
}
Obrigado...
I just want know, why this fails in Win9x/ME/NT4...