WM_MOUSELEAVE: WPARAM wParam, // not used LPARAM lParam // not usedcase WM_MOUSELEAVE: { // 鼠标离开了窗体客户区
// Do something ... }
requirs add #define _WIN32_WINNT >= 0x0400 Using the ::TrackMouseEvent API is the MS prefered method of finding when the mouse leaves a window in Windows 98 and NT 4.0
see MSDN Article ID: Q183107, "HOWTO: Detect When the Cursor Leaves the Window",
{
INT nXpos, nYpos; switch( msg )
{
case WM_MOUSEMOVE:
{
nXpos = GET_X_LPARAM(lParam);
nYpos = GET_Y_LPARAM(lParam); ...
}
break;
...
}
}
WPARAM wParam, // not used
LPARAM lParam // not usedcase WM_MOUSELEAVE:
{
// 鼠标离开了窗体客户区
// Do something
...
}
#define _WIN32_WINNT >= 0x0400
Using the ::TrackMouseEvent API is the MS prefered method of finding when
the mouse leaves a window in Windows 98 and NT 4.0
Q183107, "HOWTO: Detect When the Cursor Leaves the Window",