The question heading itself pretty much describes my overall problem. Following is what I have done so far.
// the event is registered as following
mouseProc = new CallWndRetProc(MouseProc); // get keys
MouseProcHandle = SetWindowsHookEx(WH_MOUSE_LL, mouseProc, IntPtr.Zero, 0);
// The callback method
public static IntPtr MouseProc(int nCode, int wParam, IntPtr lParam)
{
if (wParam == WM_LBUTTONUP && MouseProcHandle != IntPtr.Zero )
{
}
if (wParam == WM_MOUSEMOVE)
{
// Want to get mouse position here
}
return CallNextHookEx(IntPtr.Zero, nCode, wParam, lParam);
}
Is there a reliable way to get the mouse position ?
Code examples will be appreciated Thanks