minut Posted August 20, 2024 Posted August 20, 2024 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 This message box verifies that the Handle seen in Au3info is the same handle my script has collected in memory. 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. I would be very grateful for any insights on what I am doing wrong here.
Solution Nine Posted August 20, 2024 Solution Posted August 20, 2024 Some SysListView requires that you run it x64. You may also try #requireadmin... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
minut Posted August 20, 2024 Author Posted August 20, 2024 Wow you were right - admin was needed - unbelievable considering its all running in my user context - I am just a jo blow user.
Nine Posted August 20, 2024 Posted August 20, 2024 2 hours ago, minut said: unbelievable Not so. Some processes are running elevated without notice. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now