Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sending keys from dialog box

Status
Not open for further replies.

gtirmizi

Programmer
Oct 9, 2002
6
US
Hi,
I am writing my program in VC++ 6.0 with Win32 API support.
I have a dialog box that has two input controls (for uid and password) and OK and CANCEL button. I got the handle to the main dialog box, and now I want to identify the input controls in that dialog box and OK button.
I have got the handle of main window and I know how to send string to those boxes, but I need to know how to identify those controls, and the OK button (among other buttons). Also, how to send the key to process OK button.

I'm in desperate need for help. Thank you in advance for the help.

GT


__________________
Have a nice day

 
Use GetDlgItem() to get the HWND of the control:
Code:
    HWND hEditUID = GetDlgItem(hDlg, ID_EDIT_UID);

HTH
Shyan
 
Better would be if you use GetDlgItemText(hDlg,...) which will give you the direct text instead of handle
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top