|
写了一个计算器的拖动脚本,希望对你能有所帮助:
Set shell = CreateObject("Wscript.Shell")
shell.Run "C:\WINDOWS\system32\calc.exe"
Window("regexpwndtitle:=计算器").Activate
Dim x_source , y_source
Dim x_goal , y_goal
Dim Device 'DeviceReplay对象
x_source = Window("regexpwndtitle:=计算器").GetROProperty("abs_x") + 50
y_source = Window("regexpwndtitle:=计算器").GetROProperty("abs_y") + 10
x_goal = x_source +100
y_goal = y_source + 100
Set Device = createobject("Mercury.DeviceReplay")
Device.DragAndDrop x_source , y_source , x_goal , y_goal , LEFT_MOUSE_BUTTON
set shell = Nothing
set Device = Nothing |
|