我正在尝试创建一个空窗口,用于处理 WinProc 中的 WM_MOUSEMOVE 消息:
case WM_MOUSEMOVE:
{
HWND otherHwnd = HWND(0x000608FC);
POINT pt = {LOWORD(lParam), HIWORD(lParam)};
ClientToScreen(otherHwnd, &pt);
PostMessage(otherHwnd, WM_TIMER, WPARAM(4096), 0);
PostMessage(otherHwnd, message, wParam, lParam);
SendMessage(otherHwnd, WM_NCHITTEST, NULL, (LPARAM)MAKELONG(pt.x, pt.y));
SendMessage(otherHwnd, WM_NCHITTEST, NULL, (LPARAM)MAKELONG(pt.x, pt.y));
SendMessage(otherHwnd, WM_NCHITTEST, NULL, (LPARAM)MAKELONG(pt.x, pt.y));
SendMessage(otherHwnd, WM_SETCURSOR, WPARAM(otherHwnd), (LPARAM)MAKELONG(HTCLIENT, WM_MOUSEMOVE));
break;
}
我希望我可以在 IE 中将超链接悬停,但结果是超链接在很短的时间内仅显示为悬停样式,然后转为正常,然后再次悬停,然后正常。在 www.amazon.com,当我模拟悬停链接(“今日特卖”)时,链接闪烁。
我想有一个更好的方法可以做到,即使IE窗口被其他一些窗口覆盖,它也可以使IE与mouseevent一起行动。等待最佳解决方案~orz
上面是当我真正悬停链接时的 spy++ 日志。并且模拟与真实消息相同
<01277> 000608FC S WM_SETCURSOR hwnd:000608FC nHittest:HTCLIENT wMouseMsg:WM_MOUSEMOVE
<01278> 000608FC R WM_SETCURSOR fHaltProcessing:False
<01279> 000608FC P WM_MOUSEMOVE fwKeys:0000 xPos:406 yPos:50
<01280> 000608FC P WM_TIMER wTimerID:4096 tmprc:00000000
<01281> 000608FC S WM_NCHITTEST xPos:520 yPos:283
<01282> 000608FC R WM_NCHITTEST nHittest:HTCLIENT
<01283> 000608FC S WM_NCHITTEST xPos:520 yPos:283
<01284> 000608FC R WM_NCHITTEST nHittest:HTCLIENT
<01285> 000608FC S WM_NCHITTEST xPos:520 yPos:283
<01286> 000608FC R WM_NCHITTEST nHittest:HTCLIENT
<01287> 000608FC S WM_NCHITTEST xPos:520 yPos:283
<01288> 000608FC R WM_NCHITTEST nHittest:HTCLIENT
<01289> 000608FC S WM_SETCURSOR hwnd:000608FC nHittest:HTCLIENT wMouseMsg:WM_MOUSEMOVE
<01290> 000608FC R WM_SETCURSOR fHaltProcessing:False
<01291> 000608FC P WM_MOUSEMOVE fwKeys:0000 xPos:406 yPos:50
<01292> 000608FC P WM_TIMER wTimerID:4096 tmprc:00000000
<01293> 000608FC S WM_NCHITTEST xPos:520 yPos:283
<01294> 000608FC R WM_NCHITTEST nHittest:HTCLIENT
<01295> 000608FC S WM_NCHITTEST xPos:520 yPos:283
<01296> 000608FC R WM_NCHITTEST nHittest:HTCLIENT
<01297> 000608FC S WM_NCHITTEST xPos:520 yPos:283
<01298> 000608FC R WM_NCHITTEST nHittest:HTCLIENT
<01299> 000608FC S WM_NCHITTEST xPos:520 yPos:283
<01300> 000608FC R WM_NCHITTEST nHittest:HTCLIENT
<01301> 000608FC S WM_SETCURSOR hwnd:000608FC nHittest:HTCLIENT wMouseMsg:WM_MOUSEMOVE
<01302> 000608FC R WM_SETCURSOR fHaltProcessing:False
<01303> 000608FC P WM_MOUSEMOVE fwKeys:0000 xPos:406 yPos:50
<01304> 000608FC S WM_NCHITTEST xPos:520 yPos:283
<01305> 000608FC R WM_NCHITTEST nHittest:HTCLIENT
<01306> 000608FC P WM_TIMER wTimerID:4096 tmprc:00000000
<01307> 000608FC S WM_NCHITTEST xPos:520 yPos:283
<01308> 000608FC R WM_NCHITTEST nHittest:HTCLIENT
<01309> 000608FC S WM_NCHITTEST xPos:520 yPos:283
<01310> 000608FC R WM_NCHITTEST nHittest:HTCLIENT
<01311> 000608FC S WM_NCHITTEST xPos:521 yPos:281
<01312> 000608FC R WM_NCHITTEST nHittest:HTCLIENT