This function queries the length of the text string in a dialog item, not including any null termination character.
#define INCL_WINDIALOGS /* Or use INCL_WIN, INCL_PM, Also in COMMON section */ #include <os2.h> HWND hwndDlg; /* Parent-window handle. */ ULONG idItem; /* Identity of the child window whose text is to be queried. */ LONG lRetLen; /* Length of text. */ lRetLen = WinQueryDlgItemTextLength(hwndDlg, idItem);