Re: Set a Cursor to a Text Box

From: Billy Verreynne <vslabs_at_onwe.co.za>
Date: 1997/11/20
Message-ID: <01bcf5ad$31591400$f3040059_at_billyv.vslabs.co.za>#1/1


Virginia K. Leung <vleung_at_uoft02.utoledo.edu> wrote in article <3473DE0E.10D78E2_at_uoft02.utoledo.edu>...
> I would like to know how to set a cursor to a particular text box after
> clicking a button, in other words, setfocus to a text box.

  • WIN32 API -- The SetFocus function sets the keyboard focus to the specified window. All subsequent keyboard input is directed to this window. The window, if any, that previously had the keyboard focus loses it.

HWND SetFocus( HWND hwnd // handle of window to receive focus );

Parameters:
hwnd
Identifies the window that will receive the keyboard input. If this parameter is NULL, keystrokes are ignored.

Return Value
If the function succeeds, the return value is the handle of the window that previously had the keyboard focus. If there is no such window or if the hwnd parameter is invalid, the return value is NULL.

---

The window handle can also be the handle of textbox, button, listbox etc.


regards,
Billy
Received on Thu Nov 20 1997 - 00:00:00 CET

Original text of this message