Not finding all accessibility info with my code RRS feed

  • Question

  • Using my code I can get some of the control's info by hovering the mouse over a control on any window from accessibility info but using a program like AccExplorer 2.0 (I think this comes from Microsoft) I can get all controls info/caption that the mouse is hovering over - why cannot I see all control info with my code?

    My code:

            Dim kppoint As New POINT
            kppoint.X = Cursor.Position.X
            kppoint.Y = Cursor.Position.Y
            Dim objAccessible As Object
            Dim v As Object
            Dim sName As String
            Dim sValue As String
            Dim vState As String
            Dim sRole As String
            Dim loocc As String
            AccessibleObjectFromPoint(kppoint, objAccessible, v)

            sName = ""
            sValue = ""
            vState = ""
            loocc = ""
            On Error Resume Next
            sName = objAccessible.accName(v)
            sValue = Trim$(objAccessible.accValue(v))
            vState = objAccessible.accState(v)
            sRole = objAccessible.accRole(v)
            loocc = objAccessible.Location(v)
            On Error GoTo 0

           TextBox4.Text = sName
            TextBox2.Text = sValue
            TextBox3.Text = vState
            TextBox1.Text = sRole

    Is it my On Error Resume Next statement that is stopping the info from being read? Any help would be appreciated, I want to be able to hover over any control on any given window and get the name/caption/other details eg size/location from the control just like AccExplorer 2.0 does..


    • Moved by Martin_Xie Friday, June 18, 2010 11:28 AM Redirect to appropriate forum for better support. (From:Visual Basic General)
    Sunday, June 13, 2010 9:07 AM


All replies