The WM_ACTIVATEAPP message is 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.
WM_ACTIVATEAPP
fActive = (BOOL) wParam; // activation flag
dwThreadID = (DWORD) lParam: // thread identifier
If an application processes this message, it should return zero.
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in winuser.h.
Windows Overview, Window Messages, WM_ACTIVATE