win12.hlp (Table of Contents; Topic list)
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.
WinFocusChange (1.2)
                                                      Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_WININPUT
 
BOOL WinFocusChange(hwndDesktop, hwndSetFocus, fsFocusChange);
HWND hwndDesktop;        /* handle of the desktop      */
HWND hwndSetFocus;       /* handle of the focus window */
USHORT fsFocusChange;    /* focus-changing flags       */
 
The WinFocusChange function sets the focus to the specified window.
 
A window may temporarily set the focus to itself without changing the active
window or the selection. Examples of this are menu and scroll bar windows.
When complete, the window sets the focus back to the previous focus window.
 
Parameter      Description
────────────────────────────────────────────────────────────────────────────
 
hwndDesktop    Identifies the desktop window. This parameter can be
               HWND_DESKTOP or the desktop window handle.
 
hwndSetFocus   Identifies the new focus window.
 
fsFocusChange  Specifies the flags that control the focus-changing process.
               This parameter can be a combination of the following values:
 
               Value               Meaning
               ─────────────────────────────────────────────────────────────
               FC_NOLOSEACTIVE     Do not send the WM_ACTIVATE message to
                                   the window being deactivated.
 
               FC_NOLOSEFOCUS      Do not send the WM_SETFOCUS message to
                                   the window losing the focus.
 
               FC_NOLOSESELECTION  Do not send the WM_SETSELECTION message
                                   to the window losing the selection.
               FC_NOSETACTIVE      Do not send the WM_ACTIVATE message to
                                   the window becoming active.
 
               FC_NOSETFOCUS       Do not send the WM_SETFOCUS message to
                                   the window receiving the focus.
 
               FC_NOSETSELECTION   Do not send the WM_SETSELECTION message
                                   to the window receiving the selection.
 
               By using various combinations of these flags, an application
               can control activation, selection, focus changes, and other
               default activities, such as bringing frame windows to the top
               of their sibling windows. If fsFocusChange is zero, the
               system takes the default action (this is the same as calling
               the WinSetFocus function).
 
Return Value
 
The return value is TRUE if the function is successful or FALSE if an error
occurs.
 
See Also
 
WinQueryFocus, WinSetFocus, WM_ACTIVATE, WM_SETFOCUS