Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide to Clip-4-Win version 3.0 - <b>setfocus()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
SetFocus()
Set the window with the input focus
------------------------------------------------------------------------------

Syntax
SetFocus( <hWnd> )   -->   hOldWnd

Arguments
<hWnd> is the handle to the window to be given the input
focus.

Returns
If successful, a handle to the window that previously had the
input focus is returned as an integer.  Otherwise, zero (0) is
returned.

Description
This function can be used to set the window that has the input
focus  (i.e. the window that will receive keystrokes from the
user).  Note that zero (0) is returned if no window previously
had the input focus.

A side-effect of changing the input focus is that the window
losing the focus receives the event EVENT_KILLFOCUS, and the
new window (or its parent, if appropriate) receives the event
EVENT_SETFOCUS.  Many applications will simply ignore these
events.

Example
hOldWnd = SetFocus( hWnd )         // handle of previous owner
if  hOldWnd  !=  0
     ?  "This window had the focus: ",  hOldWnd
endif


See Also: GetFocus()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson