vb.net获取窗口坐标 vbs获取鼠标坐标( 二 )


hwnd
As
Long,
wndRect
As
RECT)
As
Long
Private
Type
RECT
'自定义区域结构类型
x
As
Long
y
As
【vb.net获取窗口坐标 vbs获取鼠标坐标】Long
Right
As
Long
Bottom
As
Long
End
Type
Dim
ActiveWindowRECT
As
RECT
'用於保存活动窗口区域的结构
Dim
ActiveWindowHwnd
As
Long
'活动窗口的句柄
Private
Sub
Timer1_Timer()
ActiveWindowHwnd
=
GetForegroundWindow
'获得活动窗口的句柄
GetWindowRect
ActiveWindowHwnd,
ActiveWindowRECT
'获得活动窗口的区域并保存在
ActiveWindowRECT
变量中
'在窗口上输出信息
Me.Cls
Print
"活动窗口的坐标是("
ActiveWindowRECT.x
","
ActiveWindowRECT.y
")"
End
Sub
关于vb.net获取窗口坐标和vbs获取鼠标坐标的介绍到此就结束了 , 不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站 。

推荐阅读