//This code will notify you when the mouse cursor leaves the window area.
case WM_MOUSEMOVE: // Set the event for next movement TRACKMOUSEEVENT trackmouseevent; trackmouseevent.cbSize = sizeof(trackmouseevent); trackmouseevent.dwFlags = TME_LEAVE; trackmouseevent.hwndTrack = hWnd; trackmouseevent.dwHoverTime = HOVER_DEFAULT; _TrackMouseEvent(&trackmouseevent); break; case WM_MOUSELEAVE: // Mouse just left the window area break; |