2 out of 8 rated this helpful - Rate this topic

WM_ACTIVATEAPP message

Applies to: desktop apps only

Sent when a window belonging to a different application than the active window is about to be activated. The message is sent to the application whose window is being activated and to the application whose window is being deactivated.

A window receives this message through its WindowProc function.

#define WM_ACTIVATEAPP                  0x001C

Parameters

wParam

Indicates whether the window is being activated or deactivated. This parameter is TRUE if the window is being activated; it is FALSE if the window is being deactivated.

lParam

The thread identifier. If the wParam parameter is TRUE, lParam is the identifier of the thread that owns the window being deactivated. If wParam is FALSE, lParam is the identifier of the thread that owns the window being activated.

Return value

Type: LRESULT

If an application processes this message, it should return zero.

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Winuser.h (include Windows.h)

See also

Reference
WM_ACTIVATE
Conceptual
Windows

 

 

Send comments about this topic to Microsoft

Build date: 2/3/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Sent to all top-level windows
The documentation above is not explicit about it. But from my tests, it looks like WM_ACTIVATEAPP for both activation and deactivation is sent to each top-level window of the thread.
Inconsistent
WM_ACTIVATEAPP was inconsistent for my program - sometimes it would be sent to my WinProc and sometimes not. I added handling of WM_NCACTIVATE, and now it works 100% of the time for what I need.
Value
WM_ACTIVATEAPP = &H1C