PDA

Click to See Complete Forum and Search --> : Get hWnd of control under mouse pointer


Gerco
Mar 2nd, 2001, 10:38 AM
How do I do that?

And how do I determine what kind of control that is?

Thanks.
Gerco.

Mar 2nd, 2001, 11:00 AM
Try this:


Private Declare Function WindowFromPoint _
Lib "user32" (ByVal xPoint As Long, ByVal yPoint As _
Long) As Long

Private Declare Function GetCursorPos Lib "user32" (lpPoint As _
POINTAPI) As Long

Private Type POINTAPI
x As Long
y As Long
End Type

Private Sub Command1_Click()

Dim P As POINTAPI
k$ = GetCursorPos(P)
j$ = WindowFromPoint(P.x, P.y)
Print k$; j$

End Sub