View Full Version : C / C++ Newbies...
matriXDesigns
15 Sep 2002, 08:37 PM
Hello-
I've noticed quite a few C/C++ newbies making posts here, including myself.
I have several books, but none of them answer a simple question - how can I read the contents of a textbox?
I think it would be really nice if someone could make a sample plugin that excersized creating dialogs (or rather just opening them), retrieving and saving preferences, etc.
Thanks.
TM
sdbarker
15 Sep 2002, 09:25 PM
UINT GetDlgItemText(
HWND hDlg,
int nIDDlgItem,
LPTSTR lpString,
int nMaxCount
);
Parameters
hDlg
[in] Handle to the dialog box that contains the control. nIDDlgItem
[in] Specifies the identifier of the control whose title or text is to be retrieved.
lpString
[out] Long pointer to the buffer to receive the title or text.
nMaxCount
[in] Specifies the maximum length, in characters, of the string to be copied to the buffer pointed to by lpString. If the length of the string exceeds the limit, the string is truncated.
Return Values
The number of characters copied to the buffer, not including the terminating null character, indicates success. Zero indicates failure. To get extended error information, call GetLastError.
Remarks
The GetDlgItemText function sends a WM_GETTEXT message to the control.
DmgInc
15 Sep 2002, 09:32 PM
Or if you are using the edit box control...
send the EM_GETLINE message w/SendMessage
sdbarker
15 Sep 2002, 10:48 PM
GetDlgItemText will retrieve the text from the edit's as well. EM_GETLINE will only retrieve a single line if the edit is multi-line.
-Scott
timvw
16 Sep 2002, 06:07 AM
this one is really interesting i tink http://www.winprog.org/tutorial/
vBulletin® v3.8.3, Copyright ©2000-2013, Jelsoft Enterprises Ltd.