问题标题本身几乎描述了我的整体问题。以下是我到目前为止所做的。
// 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);
}
有没有可靠的方法来获取鼠标位置?
代码示例将不胜感激谢谢