This example is the beginning of a function which processes the text which is displayed in the message text line.
#define INCL_WINDIALOGS #define INCL_DOSMEMMGR #include <OS2.H> #define DID_MSGEDIT 900 void SelectMessageFromText(hwndDlg) HWND hwndDlg; { char *szTemp; LONG length; /* First get the edit text from the string */ length = WinQueryDlgItemTextLength(hwndDlg, DID_MSGEDIT); /* now we know the buffer size needed. */ DosAllocMem((PPVOID)szTemp, (ULONG)length, PAG_READ | PAG_WRITE | PAG_COMMIT); WinQueryDlgItemText(hwndDlg, DID_MSGEDIT, sizeof(szTemp), (PSZ)szTemp); /* . */ /* . */ }