Microsoft Foundation Classes (mfc.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.
CWnd::SetFocus
CWnd                                        Up Contents Index Back
──Microsoft Foundation Classes──────────────────────────────────────────────
 
  CWnd* SetFocus();
 
  Remarks
 
  Claims the input focus. The input focus directs all subsequent keyboard
  input to CWnd. The window, if any, that previously had the input focus
  loses it.
 
  The SetFocus member function sends a WM_KILLFOCUS message to the CWnd
  that loses the input focus and a WM_SETFOCUS message to the CWnd that
  receives the input focus. It also activates either the CWnd or its
  parent.
 
  If the current CWnd is active but doesn't have the focus (that is, no
  window has the focus), any key pressed will produce the messages
  WM_SYSCHAR, WM_SYSKEYDOWN, or WM_SYSKEYUP.
 
  Return Value
 
  A pointer to the window object that previously had the input focus. It
  is NULL if there is no such window. The returned pointer may be
  temporary and should not be stored.
 
  See Also
 
  ::SetFocus, CWnd::GetFocus
 
 
                                     -♦-