SetText method

Available for Window, MDIWindow, DialogBox, Static, Edit, Group, Button, Check, Radio and Picture objects.


SetText Proto hWnd:HWND, lpszText:LPSTR


Invoke SetText, hWnd, lpszText


Sets the Text property of an object.



Handle to the object.


Pointer to the effective address of a null-terminated string with the new text.

Return value

Eax returns TRUE if succesful, or FALSE if not.

NOTE: The lpszText parameter can be NULL for no text.

REMARKS: The SetText method expects lpszText to be a Unicode string if the application is running as Unicode, or an ANSI string if not (see the IsAppUnicode method). You can call SetTextA to set ANSI text in Unicode applications, or SetTextW to set Unicode text in ANSI applications.