ControlGetHandle

首页  后退  前进

ControlGetHandle
down2

ControlGetHandle

获取控件的内部句柄.

 

ControlGetHandle ( "title", "text", controlID )

参数

title

目标窗口标题, 或句柄, 或类名. 参考窗口标题与文本(高级).

text

目标窗口文本. 参见 窗口标题与文本

controlID

控件标识符. 相关说明见 控件.

返回值

成功:

返回控件句柄(HWND)值.

失败:

返回 0, 设置 @error 为非 0 值, 表示未发现匹配窗口.

备注

函数返回一个 HWND 句柄值.

函数示例

#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)
    ; Retrieve the handle of the edit control in Notepad. The handle returned by WinWait is used for the "title" parameter of ControlGetHandle.
    Local $hControl = ControlGetHandle($hWnd, "", "Edit1")
    ; Display the handle of the edit control.
    MsgBox($MB_SYSTEMMODAL, "", "The handle of Edit1 is: " & $hControl)
    ; Close the Notepad window using the handle returned by WinWait.
    WinClose($hWnd)
EndFunc   ;==>Example

----------------------------------------

 

该函数可以通过命令 exect 调用

例子
copy

exect=$var_h=ControlGetHandle('[CLASS:AkelPad4]','''','AkelEditW1') scren="%p"//1||$fname||sclas<$var_h> ;; 在当前面板中创建jpg屏幕的屏幕截图,其名称为AkelPad编辑窗口的日期

up2

tcimage © Аверин Андрей для Total Commander Image Averin-And@yandex.ru