[原创]获得任何窗口的句柄
是用自己写的dll做的...
有两个dll
CursorPos.dll
windowRfromPoint.dll
代码
Dim cur As CursorPos
Dim winForm As windowsRfromPoint
Private Sub Form_Load()
Set cur = New CursorPos
Set winForm = New windowsRfromPoint
End Sub
Private Sub Timer1_Timer()
cur.CurrsorPos '获得鼠标的位置
winForm.X = cur.PosX 'cur.PosX鼠标的X坐标指定给某个窗体winForm.X
winForm.Y = cur.PosY '.......Y..................................
Text1.Text = winForm.windowsRfromPoint '获得指定点窗体的句柄
End Sub
运行程序后只要把鼠标移到你想得到句柄的窗体的标题栏就行了!