Click to Rate and Give Feedback
MSDN
MSDN Library
User Interface
User Input
Mouse Input
Notifications
 WM_MOUSEACTIVATE Notification
WM_MOUSEACTIVATE Notification

The WM_MOUSEACTIVATE message is sent when the 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.

A window receives this message through its WindowProc function.

Syntax

WM_MOUSEACTIVATE

    WPARAM wParam
    LPARAM lParam;
    

Parameters

wParam
Handle to the top-level parent window of the window being activated.
lParam
The low-order word specifies the hit-test value returned by the DefWindowProc function as a result of processing the WM_NCHITTEST message. For a list of hit-test values, see WM_NCHITTEST.

The high-order word specifies the identifier of the mouse message 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 identifier of the mouse message should be discarded. It must be one of the following values.

MA_ACTIVATEActivates the window, and does not discard the mouse message.
MA_ACTIVATEANDEATActivates the window, and discards the mouse message.
MA_NOACTIVATEDoes not activate the window, and does not discard the mouse message.
MA_NOACTIVATEANDEATDoes not activate the window, but discards the mouse message.

Remarks

The DefWindowProc function passes the message to a child window's parent window before any processing occurs. The parent window determines whether to activate the child window. If it activates the child window, the parent window should return MA_NOACTIVATE or MA_NOACTIVATEANDEAT to prevent the system from processing the message further.

Notification Requirements

Minimum DLL Version None
HeaderDeclared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1

See Also

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Values      Đonny   |   Edit   |   Show History
WM_MOUSEACTIVATE = &H21
Public Enum WM_MOUSEACTIVATE As Integer
MA_ACTIVATE = 1
MA_ACTIVATEANDEAT = 2
MA_NOACTIVATE = 3
MA_NOACTIVATEANDEAT = 4
End Enum
mouse message values      Matan99   |   Edit   |   Show History
private enum MouseMessages : int
{
MouseMove = 0x200,
LeftButtonDown = 0x201,
LeftButtonUp = 0x202,
RightButtonDown = 0x204,
RightButtonUp = 0x205,
MouseWheel = 0x20A,
MouseHWheel = 0x20E
}
(C#)
Flag as ContentBug
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker