WM_INPUTFOCUS

This message is sent to the main window associated with the thread whose input queue is gaining or losing the system input focus. This message bypasses the message queue and is sent directly to the main window's window procedure.

Parameters

wParam

TRUE if the thread is gaining the input focus, FALSE if it is loosing the input focus.

lParam

Unused, should be zero.

Comments

Threads can know if the input system has switched input to or away from their input queues. The can know this independent of the state of their input queue (whether it is full or not). This is useful information for applications that want to change some state when they gain the input focus. For example, since when an app gains the input focus it comes to the top and looks active, an application might want to draw the document selection right away rather than waiting for the input queue synchronized WM_ACTIVATE or WM_ACTIVATEAPP messages.

The input system sends a notification to a thread when a switch event affects that thread.