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
文章來源于領測軟件測試網 http://www.kjueaiud.com/