win12.hlp (Table of Contents; Topic list)
WinQueryWindowText (1.2)
                                                      Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_WINMESSAGEMGR
 
SHORT WinQueryWindowText(hwnd, cbBuf, pszBuf)
HWND hwnd;      /* handle of the window  */
SHORT cbBuf;    /* length of the buffer  */
PSZ pszBuf;     /* address of the buffer */
 
The WinQueryWindowText function copies window text into a buffer. If the
window is a frame window, the title-bar window text is copied.
 
If the window text is longer than (cbBuf - 1), only the first (cbBuf - 1)
characters of window text are copied.
 
This function sends a WM_QUERYWINDOWPARAMS message to the window identified
by the hwnd parameter.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
hwnd       Identifies the window containing the text.
 
cbBuf      Specifies the length of the buffer pointed to by the pszBuf
           parameter. If the text is larger then this value, it will be
           truncated.
 
pszBuf     Points to a buffer the receives the window text.
 
Return Value
 
The return value is the length of the returned text.
 
Comments
 
You can determine the size of the window text ahead of time by calling the
WinQueryWindowTextLength function.
 
See Also
 
WinQueryWindowTextLength, WM_QUERYWINDOWPARAMS