WM_SETFOCUS message (Windows)

Switch View :
ScriptFree
WM_SETFOCUS message

Applies to: desktop apps only

Sent to a window after it has gained the keyboard focus.

#define WM_SETFOCUS                     0x0007

Parameters

wParam

A handle to the window that has lost the keyboard focus. This parameter can be NULL.

lParam

This parameter is not used.

Return value

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.

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Winuser.h (include Windows.h)

See also

Reference
SetFocus
WM_KILLFOCUS
Conceptual
Keyboard Input

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Community Content

Greg Wittmeyer
wParam always NULL
According to my tests, wParam is always NULL, at least on Windows 7, perhaps for security reasons.

Konstantin _dtyger_
C# constant
const uint WM_SETFOCUS = 0x7;

Đonny
Value
WM_SETFOCUS = &H7