ControlGetText
获取控件文本.
ControlGetText ( "title", "text", controlID )
参数
title
|
目标窗口标题, 或句柄, 或类名. 参考窗口标题与文本(高级).
|
text
|
目标窗口文本. 参见 窗口标题与文本
|
controlID
|
控件标识符. 相关说明见 控件.
|
返回值
成功:
|
返回控件文本.
|
失败:
|
返回空字符串 "", 设置 @error 为 1.
|
函数示例
#include <MsgBoxConstants.au3>
Example()
Func Example()
; Run Notepad
Run("notepad.exe")
; Wait 10 seconds for the Notepad window to appear.
Local $hWnd = WinWait("[CLASS:Notepad]", "", 10)
; Set the edit control in Notepad with some text. The handle returned by WinWait is used for the "title" parameter of ControlSetText.
ControlSetText($hWnd, "", "Edit1", "This is some text")
; Retrieve the text of the edit control in Notepad. The handle returned by WinWait is used for the "title" parameter of ControlGetText.
Local $sText = ControlGetText($hWnd, "", "Edit1")
; Display the text of the edit control.
MsgBox($MB_SYSTEMMODAL, "", "The text in Edit1 is: " & $sText)
; Close the Notepad window using the handle returned by WinWait.
WinClose($hWnd)
EndFunc ;==>Example
----------------------------------------
参见:
ControlSetText, WinGetText, StatusbarGetText, ControlCommand
tcimg=$cm498 pause=500 exect=$var_stxt=ControlGetText('[CLASS:TBUTTONCHANGEDLG]','''','TMyPanel1')||_ViewValues('$var_stxt') ;; 调用工具栏并获取指定元素的文本(TC x32)
© Аверин Андрей для Total Commander Image Averin-And@yandex.ru
|