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_FOCUSCHANGE (1.2)
◄Message Group► ◄Overview► ◄Up► ◄Next► ◄Previous►
────────────────────────────────────────────────────────────────────────────
#define INCL_WINFRAMEMGR
WM_FOCUSCHANGE
hwnd = (HWND) HWNDFROMMP(mp1); /* window handle */
fGetFocus = (BOOL) SHORT1FROMMP(mp2); /* focus flag */
fsFocusChange = (USHORT) SHORT2FROMMP(mp2); /* focus-change flags */
The WM_FOCUSCHANGE message is sent when the focus-window changes. It is sent
to both the window gaining the focus and the window losing the focus.
Parameter Description
────────────────────────────────────────────────────────────────────────────
hwnd Low and high words of mp1. This parameter identifies the
window gaining or losing the focus.
fGetFocus Low word of mp2. Specifies whether the window (identified by
the hwnd parameter) is gaining or losing the focus. A value
of FALSE means the window is gaining the focus; TRUE means
the window is losing the focus.
fsFocusChange High word of mp2. Specifies flags that modify the
focus-change process. This parameter can be any combination
of the following values:
Value Meaning
─────────────────────────────────────────────────────────────
FC_NOSETFOCUS Do not send a WM_SETFOCUS message to the
window receiving the focus.
FC_NOLOSEFOCUS Do not send a WM_SETFOCUS message to the
window losing the focus.
FC_NOSETACTIVE Do not send a WM_ACTIVATE message to the
window becoming active.
FC_NOLOSEACTIVE Do not send a WM_ACTIVATE message to the
window being deactivated.
FC_NOSETSELECTION Do not send a WM_SETSELECTION message to
the window receiving the selection.
FC_NOLOSESELECTION Do not send a WM_SETSELECTION message to
the window losing the selection.
Return Value
An application should return zero if it processes this message.
Comments
The window losing the focus receives a WM_FOCUSCHANGE message with hwnd set
to the handle of the window gaining the focus and fGetFocus set to FALSE.
The window gaining the focus receives a WM_FOCUSCHANGE message with hwnd set
to the handle of the window losing the focus and fGetFocus set to TRUE.
See Also
WinFocusChange, WinSetFocus, WM_ACTIVATE, WM_QUERYFOCUSCHAIN, WM_SETFOCUS,
WM_SETSELECTION
♦