ControlFocus

首页  后退  前进

ControlFocus
down2

ControlFocus

设置输入焦点到窗口的指定控件.

 

ControlFocus ( "title", "text", controlID )

参数

title

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

text

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

controlID

设置焦点的控件标识符. 相关说明见 控件.

返回值

成功:

返回 1.

失败:

返回 0.

 

函数示例

Example()
Func Example()
    ; Run Notepad
    Run("notepad.exe")
    ; Wait 10 seconds for the Notepad window to appear.
    Local $hWnd = WinWait("[CLASS:Notepad]", "", 10)
    ; Set input focus to the edit control of Notepad using the handle returned by WinWait.
    ControlFocus($hWnd, "", "Edit1")
    ; Wait for 2 seconds.
    Sleep(2000)
    ; Close the Notepad window using the handle returned by WinWait.
    WinClose($hWnd)
EndFunc   ;==>Example

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

ControlGetFocus, ControlCommand, ControlSend

例子
copy

tcimg=$cm498 pause=200 exect=ControlFocus('[CLASS:TBUTTONCHANGEDLG]','''','TAltEdit1') ;; 调用工具栏并在"提示"字段中设置焦点(TC x32)

up2

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