Declare Function SetWindowText Lib "user32.dll" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long
Platforms: Win 32s, Win 95/98, Win NT
SetWindowText changes the text that appears in the title bar of a window. Although this works with any window, including ones your program doesn't own, other programs won't expect their window titles to be changed, so use this with care on windows you didn't create. The function returns 0 if an error occured, or 1 if successful.
Example:
' 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")
Related Call: GetWindowText
Category: Windows
Back to the index.