Method Reference (COM)

WinGetText

ウィンドウのテキストを取得します。

WinGetText "title" [, "text"]

 

パラメータ

title 対象となるウィンドウのタイトル
text オプション: 対象となるウィンドウのテキスト

 

返し値

ウィンドウのテキストを格納した文字列を返します。

 

注意

64KBまでのウィンドウテキストを取得できます。WinGetTextは最小化したウィンドウに対して有効です。ただし、隠されたウィンドウに対してはAutoItSetOption("WinDetectHiddenText", 1)と設定しないと動作しません。
もし複数のウィンドウがWinGetTextの処理の対象に該当する場合、もっともアクティブなウィンドウの情報が返されます。
アクティブなウィンドウのテキストを取得するにはWinGetText("") としてください。

 

関連

WinGetTitle, ControlGetText

 

Set oAutoIt = WScript.CreateObject("AutoItX3.Control")
text = oAutoIt.WinGetText("Untitled -", "")
WScript.Echo "Text read was:" & text