[按键精灵] 纯文本查看 复制代码
Call RunApp("notepad.exe")
Delay 1500
//0表示忽略
//下面这句是查找窗口类名("Notepad")或者标题(0),返回找到的句柄Hwnd
Hwnd = Plugin.Window.Find("Notepad", 0)
//下面这句是得到窗口句柄的客户区大小
sRect = Plugin.Window.GetClientRect(Hwnd)
MsgBox "得到窗口句柄的客户区大小为:"& sRect
//下面这句用于分割字符串,将横坐标和纵坐标分成两个字符串
dim MyArray
MyArray = Split(sRect, "|")
//下面这句将字符串转换成数值
L = Clng(MyArray(0)): T = Clng(MyArray(1))
R = Clng(MyArray(2)): B = Clng(MyArray(3))
Msgbox "左" & L & ",右 "& R & ",上" & T & ",下" & B