Hook works fine but need help for callback procedure!
Hi @All,
I use a DLL with hooks to control the menu items selection from another
application (the application is also programmed by me). The application is
programmed in another language and has an own window but doesn't have any GUI
commands. So I create a menu and menu items with my DLL and I use in my DLL
hook to control user selection . It works fine but I cannot control the mouse
click. I get the message if the user over item but I need the message if user
also is clicking the item (not only over an item)!
How must I change my callback procedure?
Here is my CALLBACK code:
LRESULT CALLBACK MessageProc(int nCode, WPARAM wParam, LPARAM lParam)
{
MSG * Pmsg = (MSG *)lParam;
int wmId;
if(nCode==MSGF_MENU)
{
wmId = LOWORD(Pmsg->wParam);
switch(wmId)
{
case IDM_EXIT:
MessageBox(NULL , "You selected Exit an Item!" , "Item selection test" ,
MB_OK);
break;
default:
break;
}
}
return CallNextHookEx(hhook, nCode, wParam, lParam);
}
Thanks for help.
les