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.