Function Reference


WinSetTitle

Changes the title of a window.

WinSetTitle ( "title", "text", "newtitle" )

Parameters

title The title/hWnd/class of the window to change. See Title special definition.
text The text of the window to change. See Text special definition.
newtitle The new title to give to the window.

Return Value

Success: 1.
Failure: 0 if the window is not found.

Remarks

If multiple windows match the criteria the title of most recently active window is changed.

Related

AutoItWinSetTitle, WinGetHandle, WinGetTitle, WinTitleMatchMode (Option)

Example

Example()

Func Example()
    ; Run Notepad
    Run("notepad.exe")

    ; Wait 10 seconds for the Notepad window to appear.
    Local $hWnd = WinWait("[CLASS:Notepad]", "", 10)

    ; Set the title of the Notepad window using the handle returned by WinWait.
    WinSetTitle($hWnd, "", "New Notepad Title - AutoIt")

    ; Wait for 2 seconds to display the Notepad window and the new title.
    Sleep(2000)

    ; Close the Notepad window using the handle returned by WinWait.
    WinClose($hWnd)
EndFunc   ;==>Example