Re: CALLBACK errror on class
First of all you can't use non-static member function of the class as the callback. You can use global function or static member function as the callback. And the next in SetWindowsHookEx function you should provide the address of the function, which is CHECK::LowLevelKeyboardProc without ampersand (&), in second parameter:
Code:
class CHECK
{
public:
static LRESULT CALLBACK LowLevelKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam);
};
and then in _tmain:
Code:
g_hMouseHook = SetWindowsHookEx( WH_MOUSE_LL, (HOOKPROC)CHECK::LowLevelKeyboardProc, GetModuleHandle(NULL), 0 );
Re: CALLBACK errror on class
Thanks dear...
Now working fine...
But now its working as infinite loop. I want to take control out or unload the mouse event after a single left click
Re: CALLBACK errror on class
You can handle WM_LBUTTONDOWN message in LowLevelKeyboardProc as below:
Code:
case WM_LBUTTONDOWN:
PostQuitMessage(0);
break;
This will allow to exit from the message loop in _tmain when left mouse button is clicked.
Re: CALLBACK errror on class
Thanks a lot for u r valuable help.
Now i am getting.
If u dont mind may i asl 1 more question.
How to show mouse pointer. Now i am not getting mouse pointer