Set shell = CreateObject("Wscrīpt.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
文章来源于领测软件测试网 https://www.ltesting.net/