WM_SETFOCUS

The WM_SETFOCUS message is sent to a window after it has gained the keyboard focus.

WM_SETFOCUS 
hwndLoseFocus = (HWND) wParam; // handle to window losing focus 
 

Parameters

hwndLoseFocus
Value of wParam. Handle to the window that has lost the keyboard focus (may be NULL).

Return Values

An application should return zero if it processes this message.

Remarks

To display a caret, an application should call the appropriate caret functions when it receives the WM_SETFOCUS message.

QuickInfo

  Windows NT: Requires version 3.1 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Requires version 1.0 or later.
  Header: Declared in winuser.h.

See Also

Keyboard Input Overview, Keyboard Input Messages, SetFocus, WM_KILLFOCUS