Jump to content

WM ACTIVATE

From EDM2
Revision as of 23:03, 9 April 2025 by Martini (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This message occurs when an application causes the activation or deactivation of a window.

Syntax

param1
    USHORT  usactive    /*  Active indicator. */

param2
    HWND    hwnd        /*  Window handle. */

Parameters

usactive (USHORT)
Active indicator.
TRUE
he window is being activated
FALSE
The window is being deactivated.
hwnd (HWND)
Window handle.
In the case of activation, hwnd identifies the window being activated. In the case of deactivation, hwnd identifies the window being deactivated.

Returns

ulReserved (ULONG)
Reserved value, should be 0.

Remarks

A deactivation message (that is, a WM_ACTIVATE message with usactive set to FALSE) is sent first to the window procedure of the main window being deactivated, before an activation message (that is, a WM_ACTIVATE message with usactive set to TRUE) is sent to the window procedure of the main window being activated.

Any WM_SETFOCUS messages with usfocus set to FALSE, are sent before the deactivation message. Any WM_SETFOCUS messages with usfocus set to TRUE, are sent after the activation message.

If WinSetFocus is called during the processing of a WM_ACTIVATE message, a WM_SETFOCUS message with usfocus set to FALSE is not sent, as no window has the focus.

If a window is activated before any of its children have the focus, this message is sent to the frame window or to its FID_CLIENT, if it exists.

Note: Except in the instance of a WM_ACTIVATE message, with usactive set to TRUE, an application processing a WM_ACTIVATE, or a WM_SETFOCUS message should not change the focus window or the active window. If it does, the focus and active windows must be restored before the window procedure returns from processing the message. For this reason, any dialog boxes or windows brought up during the processing of a WM_ACTIVATE, or a WM_SETFOCUS message should be system modal.

Default Processing

The default window procedure takes no action on this message, other than to set ulReserved to 0.

In Frame Controls

Remarks

The frame control window procedure responds to this message by first sending a TBM_SETHILITE message to the FID_TITLEBAR control, if it exists, to highlight or unhighlight the title bar. If the style is FCF_DLGBORDER, the border is redrawn in either highlighted or unhighlighted state, as necessary.

It then sends the WM_ACTIVATE message to the FID_CLIENT window.

Then it sets ulReserved to 0.

Default Processing

The default window procedure takes no action on this message, other than to set ulReserved to 0.

Language Support Dialog

Remarks

The Language Support Dialog Procedure responds to this message by issuing the WinDefDlgProc function, then posting a WM_PACTIVATE message to the application queue and setting ulReserved to the result of the WinDefDlgProc function.

Default Processing

The default window procedure takes no action on this message, other than to set ulReserved to 0.

Language Support Window

Remarks

The Language Support Window Procedure responds to this message by posting a WM_PACTIVATE message to the application queue and setting ulReserved to 0.

Default Processing

The default window procedure takes no action on this message, other than to set ulReserved to 0.

Related Messages

  • WM_ACTIVATE (in Frame Controls)
  • WM_ACTIVATE (Language Support Dialog)
  • WM_ACTIVATE (Language Support Window)