Changes the title of a window.
WinSetTitle ( "title", "text", "newtitle" )
If multiple windows match the criteria the title of most recently active window is changed.
CAUTION: From Windows release 19H1 the title of "notepad.exe" reverts to the original when the window gets focus !!!
AutoItWinSetTitle, WinGetHandle, WinGetTitle, WinTitleMatchMode (Option)
Example()
Func Example()
; Run Write
Run ("Write.exe")
; Wait 10 seconds for the Write window to appear.
Local $hWnd= WinWait ("[CLASS:WordPadClass]","",10)
; Set the title of the Write window using the handle returned by WinWait.
WinSetTitle ($hWnd,"","New WordPad Title - AutoIt")
; Wait for 2 seconds to display the Write window and the new title.
Sleep (2000)
; Close the Write window using the handle returned by WinWait.
WinClose ($hWnd)
EndFunc ;==>Example