Declare Function SetWindowText Lib "user32.dll" Alias "SetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String) As Long
SetWindowText changes the text of a given window. Although this function can set the text of regular windows owned by other programs, it cannot change the text of a control owned by a different program. To set the text of those controls, use the WM_SETTEXT message instead.
If an error occured, the function returns 0 (use GetLastError to get the error code). If successful, the function returns a non-zero value.
' This code is licensed according to the terms and conditions listed here.
' Set the title bar of window Form1 to "Generic Application 1.0".
Dim retval As Long ' return value
retval = SetWindowText(Form1.hWnd, "Generic Application 1.0")
Go back to the alphabetical Function listing.
Go back to the Reference section index.
Last Modified: February 12, 2000.
This page is copyright © 2000 Paul Kuliniewicz. Copyright Information.
Go back to the Windows API Guide home page.
E-mail: vbapi@vbapi.com Send Encrypted E-Mail
This page is at http://www.vbapi.com/ref/s/setwindowtext.html