Decades whether the mouse moves to the window

zhaozj2021-02-16  89

There are two ways.

The first is to use WM_TIMER, where the mouse is inspected, but the efficiency is relatively low, it is not recommended.

The second is to use TrackMouseevent. Recommended. Specific Usage Reference MSDN

TRACKMOUSEEVENT; Event.cbsize = sizeof (event); event.dwflags = tme_leave; event.dwhovertime = 0; Event.hwndtrack = getsafehwnd (); verify (_trackmounteevent (& evevent));

Note Add WM_MOUSELEAVE message processing

Lresult Cstatlist :: OnMouseLeave (WPARAM WPARAM, LPARAM LPARAM) {RRRETURN 0;}

ON_MESSAGE (WM_MOUSELEAVE, ONMOUSELEAVE)

AFX_MSG LRESULT ONMOUSELEAVE (WPARAM WPARAM, LPARAM LPARAM);

转载请注明原文地址:https://www.9cbs.com/read-11951.html

New Post(0)