Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
WM_SETFOCUS (1.2)
◄Message Group► ◄Overview► ◄Up► ◄Next► ◄Previous►
────────────────────────────────────────────────────────────────────────────
#define INCL_WINMESSAGEMGR
WM_SETFOCUS
hwnd = HWNDFROMMP(mp1); /* window ID */
fFocus = (BOOL) SHORT1FROMMP(mp2); /* focus flag */
The WM_SETFOCUS message is sent when a window is to receive or lose the
input focus.
An application processing a WM_SETFOCUS message should not change the focus
window or the active window. If it does, the focus window and active window
must be restored before the application returns from processing the message.
For this reason, any dialog boxes or windows brought up during WM_SETFOCUS
or WM_ACTIVATE processing should be system modal.
The default window procedure takes no action on this message.
Parameter Description
────────────────────────────────────────────────────────────────────────────
hwnd Low and high word of mp1. Identifies the window gaining or losing
the focus. This parameter is NULL if no window previously had the
focus.
fFocus Low word of mp2. Specifies whether the window is receiving or
losing the focus. If this parameter is TRUE, the window is
receiving the focus. If it is FALSE, the window is losing the
focus.
Return Value
An application should return zero if it processes this message.
See Also
WM_ACTIVATE, WM_FOCUSCHANGE
♦