Finding Listview in W32framework app

Dec 17, 2009 at 10:46 PM

I'm trying to access the listview control on a GroupBox in a VB6 application that I do not control the source code.

Visual UI Automation Verify gives me the following path

Element:
  • Name=MAILdb v.00.07.06.43 [DB\MAILDB.MDB]
  • RuntimeID=42.51185674
  • Class Name=ThunderRT6FormDC
  • Automation Id=
  • Localized Control Type=window
Element:
  • Name=8 Jobs fred001 selected
  • RuntimeID=42.1444372
  • Class Name=ThunderRT6Frame
  • Automation Id=16
  • Localized Control Type=group
Element:
  • Name=
  • RuntimeID=42.1313406
  • Class Name=ListView20WndClass
  • Automation Id=
  • Localized Control Type=pane
Element:
  • Name=
  • RuntimeID=42.2296204
  • Class Name=msvb_lib_header
  • Automation Id=
  • Localized Control Type=pane
And LogStructure() gives me
AutomationId: 16
    ControlType: ControlType.Group
    Name: 8 Jobs            no job selected
    HelpText:
    Bounding rectangle: 622,405,897,669
    ClassName: ThunderRT6Frame
    IsOffScreen: False
    FrameworkId: Win32
    ProcessId: 5060


        AutomationId:
        ControlType: ControlType.Pane
        Name:
        HelpText:
        Bounding rectangle: 626,421,889,649
        ClassName: ListView20WndClass
        IsOffScreen: False
        FrameworkId: Win32
        ProcessId: 5060

        System.Windows.Automation.ScrollPattern

            AutomationId:
            ControlType: ControlType.Pane
            Name:
            HelpText:
            Bounding rectangle: 629,424,885,17
            ClassName: msvb_lib_header
            IsOffScreen: False
            FrameworkId: Win32
            ProcessId: 5060


            AutomationId: Horizontal ScrollBar
            ControlType: ControlType.ScrollBar
            Name: Horizontal Scroll Bar
            HelpText:
            Bounding rectangle: 629,1051,883,16
            ClassName:
            IsOffScreen: False
            FrameworkId: Win32
            ProcessId: 5060

            System.Windows.Automation.RangeValuePattern

                AutomationId: SmallDecrement
                ControlType: ControlType.Button
                Name: Back by small amount
                HelpText:
                Bounding rectangle: 629,1051,16,16
                ClassName:
                IsOffScreen: False
                FrameworkId: Win32
                ProcessId: 5060

                System.Windows.Automation.InvokePattern

                AutomationId: LargeDecrement
                ControlType: ControlType.Button
                Name: Back by large amount
                HelpText:
                Bounding rectangle: Empty
                ClassName:
                IsOffScreen: True
                FrameworkId: Win32
                ProcessId: 5060

                System.Windows.Automation.InvokePattern

                AutomationId: Thumb
                ControlType: ControlType.Thumb
                Name: Thumb
                HelpText:
                Bounding rectangle: 645,1051,726,16
                ClassName:
                IsOffScreen: False
                FrameworkId: Win32
                ProcessId: 5060


                AutomationId: LargeIncrement
                ControlType: ControlType.Button
                Name: Forward by large amount
                HelpText:
                Bounding rectangle: 1371,1051,125,16
                ClassName:
                IsOffScreen: False
                FrameworkId: Win32
                ProcessId: 5060

                System.Windows.Automation.InvokePattern

                AutomationId: SmallIncrement
                ControlType: ControlType.Button
                Name: Forward by small amount
                HelpText:
                Bounding rectangle: 1496,1051,16,16
                ClassName:
                IsOffScreen: False
                FrameworkId: Win32
                ProcessId: 5060

                System.Windows.Automation.InvokePattern
And when I list all elements I get:
<White.Core.UIItems.GroupBox object at 0x000000000000006E [GroupBox. AutomationId:16, Name:8 Jobs            fred001 selected, ControlType:group, FrameworkId:Win32]>
>>> ml(gb.Items)
Panel. AutomationId:, Name:, ControlType:pane, FrameworkId:Win32
Panel. AutomationId:, Name:, ControlType:pane, FrameworkId:Win32
Button. AutomationId:SmallDecrement, Name:Back by small amount, ControlType:button, FrameworkId:Win32
Button. AutomationId:LargeDecrement, Name:Back by large amount, ControlType:button, FrameworkId:Win32
Thumb. AutomationId:Thumb, Name:Thumb, ControlType:thumb, FrameworkId:Win32
Button. AutomationId:LargeIncrement, Name:Forward by large amount, ControlType:button, FrameworkId:Win32
Button. AutomationId:SmallIncrement, Name:Forward by small amount, ControlType:button, FrameworkId:Win32
>>> gb.Items[0]
<White.Core.UIItems.Panel object at 0x00000000000000A6 [Panel. AutomationId:, Name:, ControlType:pane, FrameworkId:Win32]>
>>> gb.Items[1]
<White.Core.UIItems.Panel object at 0x00000000000000A7 [Panel. AutomationId:, Name:, ControlType:pane, FrameworkId:Win32]>
>>> gb.Items[0].Items
List[IUIItem]([
           <White.Core.UIItems.Panel object at 0x00000000000000A8 [Panel. AutomationId:, Name:, ControlType:pane, FrameworkId:Win32]>,
           <White.Core.UIItems.Button object at 0x00000000000000A9 [Button. AutomationId:SmallDecrement, Name:Back by small amount, ControlType:button, FrameworkId:Win32]>,
           <White.Core.UIItems.Button object at 0x00000000000000AA [Button. AutomationId:LargeDecrement, Name:Back by large amount, ControlType:button, FrameworkId:Win32]>,
           <White.Core.UIItems.Thumb object at 0x00000000000000AB [Thumb. AutomationId:Thumb, Name:Thumb, ControlType:thumb, FrameworkId:Win32]>,
           <White.Core.UIItems.Button object at 0x00000000000000AC [Button. AutomationId:LargeIncrement, Name:Forward by large amount, ControlType:button, FrameworkId:Win32]>,
           <White.Core.UIItems.Button object at 0x00000000000000AD [Button. AutomationId:SmallIncrement, Name:Forward by small amount, ControlType:button, FrameworkId:Win32]>])
>>> gb.Items[1].Items
List[IUIItem]()
>>>
Can anyone help me to access the content of the listview20?
And yes it look strange since I'm using IronPython.
WombatPM
Coordinator
Dec 25, 2009 at 6:50 AM

You would have to create Custom UI Item.

http://white.codeplex.com/wikipage?title=Custom%20UI%20Item&referringTitle=Home