Function Reference


WinGetText

Retrieves the text from a window.

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

Parameters

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

Return Value

Success: a string containing the window text read.
Failure: "" if the window is not found.

Remarks

Up to 64KB of window text can be retrieved. WinGetText() works on minimized windows, but only works on hidden windows if you've set AutoItSetOption("WinDetectHiddenText", 1)
If multiple windows match the criteria for WinGetText(), the information for the most recently active match is returned.
Use WinGetText("[active]") to get the active window's text.

Related

ControlGetText(), WinGetClassList(), WinGetTitle()

Example

#include <MsgBoxConstants.au3>

Example()

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

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