void SetWindowText(hwnd, lpsz) | ||||
HWND hwnd; | /* handle of window, */ | |||
LPCSTR lpsz; | /* address of string, */ |
The SetWindowText function sets the given window's title to the specified text.
hwnd
Identifies the window or control whose text is to be set.
lpsz
Points to a null-terminated string to be used as the new title or control text.
This function does not return a value.
This function causes a WM_SETTEXT message to be sent to the given window or control.
If the window specified by the hwnd parameter is a control, the text within the control is set. If the specified window is a list-box control created with WS_CAPTION style, however, SetWindowText will set the caption for the control, not for the list-box entries.
The following example sets a window title:
char szBuf[64];
char szFileName[64];
wsprintf((LPSTR) szBuf, "PrntFile - %s", (LPSTR) szFileName);
SetWindowText(hwnd, (LPSTR) szBuf);