This example shows how to query window text.
#define INCL_WINWINDOWMGR #include <OS2.H> #define FID_CLIENT 255 HWND hwndFrame; HWND hwndClient; char szTitle[32]; /* This function creates a new window of */ /* class Generic and returns hwnd. */ hwndClient = WinCreateWindow(hwndFrame, "Generic", (PSZ)"My Window", /* No window text */ 0UL, /* No window style */ 0,0,0,0, /* Position and size */ (HWND)NULL, /* No owner */ HWND_TOP, /* On top of siblings */ FID_CLIENT, /* Client window ID */ NULL, /* Control data */ NULL); /* Pres. params */ WinQueryWindowText(hwndFrame, sizeof(szTitle), szTitle);