按键精灵3级问答认证题目 5
窗口某点的前台坐标为(300,400),用命令获取该点的对应后台坐标,提示:window插件,请作答。?...
窗口某点的前台坐标为(300,400),用命令获取该点的对应后台坐标,提示: window插件,请作答。?
展开
2个回答
展开全部
Dim x, y, hwnd, dx, xy, intx, inty, xx, yy
x = 300 : y = 400
//得到当前窗口句柄
Hwnd = Plugin.Window.Foreground()
//得到窗口句柄的边框大小(包括标题栏)
dx = Plugin.Window.GetWindowRect(Hwnd)
xy = split(dx, "|")
intx = cint(xy(0)) : inty = cint(xy(1))
xx = x - intx : yy = y - inty//后台坐标=前台坐标-窗口左上角坐标
TracePrint xx & "," & yy
x = 300 : y = 400
//得到当前窗口句柄
Hwnd = Plugin.Window.Foreground()
//得到窗口句柄的边框大小(包括标题栏)
dx = Plugin.Window.GetWindowRect(Hwnd)
xy = split(dx, "|")
intx = cint(xy(0)) : inty = cint(xy(1))
xx = x - intx : yy = y - inty//后台坐标=前台坐标-窗口左上角坐标
TracePrint xx & "," & yy
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询