user iconcanadian_coder on June 26th 2006
9995 views

topic iconGetting text from a text field

Hi Folks;

As you might have guessed I'm pretty new to the whole Win32 programming so bear with me.

I have an application that produces a number of text fields, drop-down lists and a couple buttons. In this thread I'm hoping to find someone who knows how I can get text from a text field (or could point me to some examples or a list of functions).

Thanks!

user iconVlasta on June 27th 2006 0

The basic way in Win32 is to send a WM_GETTEXT message to the text field. It may look like this:

TCHAR buffer[100];
SendMessage(handleToYourTextBox, WM_GETTEXT, 100, (LPARAM)buffer);

If you are using something like MFC, WTL, or .NET Framework, there also is another way specific for your framework.

user icon