WinGetClassList

首页  后退  前进

WinGetClassList
down2

WinGetClassList

获取窗口类名.

 

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

参数

title

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

text

[可选] 目标窗口文本. 默认值为空字符串. 参考 窗口标题与文本.

返回值

成功:

返回包含窗口类的字符串.

失败:

返回 "", 设置 @error 为非 0 值, 没有符合条件的窗口.

备注

类名由换行符 @LF 分隔. 本函数对于最小化或隐藏窗口仍能正常工作.

最多能获取 64 KB 的文本内容. 若同时有多个窗口符合匹配条件, 则读取最近激活窗口的类

 

函数示例

#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 classlist of the Notepad window using the handle returned by WinWait.
    Local $sClassList = WinGetClassList($hWnd)
    ; Display the classlist.
    MsgBox($MB_SYSTEMMODAL, "", $sClassList)
    ; Close the Notepad window using the handle returned by WinWait.
    WinClose($hWnd)
EndFunc   ;==>Example

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

参见:

WinGetText, ControlCommand

例子
copy

exect=$var_handle=WinGetHandle('[CLASS:TTOTAL_CMD]')||$var_aclass=StringSplit(WinGetClassList(Eval('var_handle')),@LF)||_ViewValues($var_aclass) ;; 返回数组Total Commander元素的所有类

 

exect=$var_aclass=StringSplit(WinGetClassList('[CLASS:TTOTAL_CMD]'),@LF)||_ViewValues($var_aclass) ;; 返回数组Total Commander元素的所有类

up2

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