WM_MOUSEACTIVATE

WM_MOUSEACTIVATE

hwndTopLevel = (HWND) wParam; /* handle of top-level parent */

nHittest = (INT) LOWORD(lParam); /* hit-test code */

uMsg = (UINT) HIGHWORD(lParam); /* mouse message */

The WM_MOUSEACTIVATE message is sent when the mouse cursor is in an inactive window and the user presses a mouse button. The parent window receives this message only if the child window passes it to the DefWindowProc function.

Parameters

hwndTopLevel

Value of wParam. Identifies the top-level parent window of the window being activated.

nHittest

Value of the low-order word of lParam. Specifies the hit-test code returned by the DefWindowProc function as a result of processing the WM_NCHITTEST message. For more information, see the description of the WM_NCHITTEST message.

uMsg

Value of the high-order word of lParam. Specifies the identifier of the mouse message that was generated when the user pressed a mouse button. The mouse message is either discarded or posted to the window, depending on the return value.

Return Value

The return value specifies whether the window should be activated and whether the mouse message specified by the uMsg parameter should be discarded. It must be one of the following values:

Value Meaning

MA_ACTIVATE Activate the window.
MA_NOACTIVATE Do not activate the window.
MA_ACTIVATEANDEAT Activate the window and discard the mouse message.
MA_NOACTIVATEANDEAT Do not activate the window and discard the mouse message.

Comments

If the child window passes the WM_MOUSEACTIVATE message to the DefWindowProc function, DefWindowProc passes the message to a window's parent window before any processing occurs. If the parent window returns TRUE, processing is halted.

See Also

WM_NCHITTEST