Results 1 to 2 of 2

Thread: Get hWnd of control under mouse pointer

  1. #1
    Gerco
    Guest
    How do I do that?

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

    Thanks.
    Gerco.

  2. #2
    Guest
    Try this:


    Code:
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width