Method WinClose

AutoIt X

Method Reference


WinClose

Closes a window

WinClose "title" [, "text"]

Parameters

title The title of the window to close.
text Optional: The text of the window to close.

Return Value

None.

Remarks

This function sends a close message to a window, the result depends on the window (it may ask to save data, etc.). To force a window to close, use the WinKill function. If multiple windows match the criteria, the window that was most recently active is closed.

Related

WinActivate, WinExists, WinKill, WinSetState, WinTitleMatchMode (Option)

Example


Set oAutoIt = WScript.CreateObject("AutoItX3.Control")
oAutoIt.WinClose "Untitled - Notepad", ""