ControlMove

首页  后退  前进

ControlMove
down2

ControlMove

移动窗口内的控件.

 

ControlMove ( "title", "text", controlID, x, y [, width [, height]] )

参数

title

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

text

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

controlID

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

x

移动到窗口客户区的相对 X 坐标值.

y

移动到窗口客户区的相对 Y 坐标值.

width

[可选] 窗口的新宽度.

height

[可选] 窗口的新高度.

返回值

成功:

返回 1.

失败:

返回 0, 未找到窗口/控件.

备注

如果 X 与 Y 坐标等于关键字 Default 将不会发生移动, 仅恢复到所要求的大小.

 

函数示例

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

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

 

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

参见:

ControlGetPos, ControlCommand

例子
copy

exect=ControlMove('[CLASS:TTOTAL_CMD]','''','TButtonBar1',10,10)||Sleep(2000)||ControlMove('[CLASS:TTOTAL_CMD]','''','TButtonBar1',0,2) ;; 移动工具栏2秒(TC x32)

up2

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