按键精灵怎么获取窗口坐标啊

用句柄+截图的方式获取的坐标不对啊。
2024-11-04 18:18:49
推荐回答(1个)
回答1:

Hwnd = Plugin.Window.Foreground()
sRect = Plugin.Window.GetClientRect(Hwnd)
MsgBox "得到窗口句柄的客户区大小为:"& sRect
//下面这句用于分割字符串,将横坐标和纵坐标分成两个字符串
MyArray = Split(sRect, "|")
//下面这句将字符串转换成数值
L = Clng(MyArray(0)): T = Clng(MyArray(1))
R = Clng(MyArray(2)): B = Clng(MyArray(3))
Msgbox "左" & L & ",右 "& R & ",上" & T & ",下" & B