Function Reference


WinGetTitle

Retrieves the full title from a window.

WinGetTitle ( "title" [, "text"] )

Parameters

title The title/hWnd/class of the window to get the title. See Title special definition.
text [optional] The text of the window to get the title. Default is an empty string. See Text special definition.

Return Value

Success: a string containing the complete window title.
Failure: "" if the window is not found.

Remarks

WinGetTitle("[active]") returns the active window's title. WinGetTitle() works on both minimized and hidden windows. If multiple windows match the criteria, the most recently active window is used.

Related

AutoItWinGetTitle, WinGetText, WinSetTitle, WinTitleMatchMode (Option)

Example

#include <MsgBoxConstants.au3>

Example()

Func Example()
        ; Retrieve the window title of the active window.
        Local $sText = WinGetTitle("[ACTIVE]")

        ; Display the window title.
        MsgBox($MB_SYSTEMMODAL, "", $sText)
EndFunc   ;==>Example