Jump to content

Interaction with ListView control types not working.


Go to solution Solved by Nine,

Recommended Posts

Posted

The background to this post is UI automation, driving someone else's UI. As its compiled code I don't have any insights beyond what Au3Info offers.

I have been trying [and failing] to make decisions in my code based on the data presented in a ListView control. However all attempts to use functions against this control fail. I must be doing something silly.

Here is the code.

Local $cClass = "Policy File Importer"
    Local $cWindow = WinWaitActive($cClass)
    SendKeepActive($cWindow)
    Local $listviewboxhandle = ControlGetHandle($cWindow,"",'WindowsForms10.SysListView32.app.0.141b42a_r8_ad11')
    MsgBox ($MB_SYSTEMMODAL,"Test",$listviewboxhandle)
    
    Local   $boxcount = _GUICtrlListView_GetItemCount($listviewboxhandle)
    MsgBox ($MB_SYSTEMMODAL,"Annoying",$boxcount)

Here are the annotations.

This is where I am using Au3Info to work out the control classname

handle_data.thumb.jpg.f0c6508fa5c598139fd758b75ad3e7e0.jpg

 

This message box verifies that the Handle seen in Au3info is the same handle my script has collected in memory.

handle_dialogue.jpg.ec68d2cddd45a020ed62fbc4ca5d8e2b.jpg

 

After the list box is populated I am calling Local $boxcount line in the code above to return the number of items in the list box which is clearly three, but the GetItemCount function is returning 0 every time. As I say I am simply unable to interact with the list box programmatically. Using the mouse, works fine though.

Item_count.jpg.8f19710c2f2ad367777064f0f659329a.jpg

I would be very grateful for any insights on what I am doing wrong here.

  • Solution
Posted

Wow you were right - admin was needed - unbelievable considering its all running in my user context - I am just a jo blow user. 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...