greg_ward02 Posted November 13, 2021 Posted November 13, 2021 I am trying to use AutoIt to help me interact with an external application window with a list/grid view control. I need to get the text from the list. Depending on the value of the text of the items, highlight a specific item, then click a button. Ultimately I will need to do this over and over again (7K+ times) which is why I figured I'd use AutoIt. I have created other scripts and can interact with typical items like buttons, but this list/grid view is giving me a hard time. I can't seem to get text from it. Here is the control I am trying to interact with: I will need to capture the text to figure out which item has "Vendor 2" (it's not always the second one listed). I'll need to select it then click a button to delete this item. The info window is: Here are a few things I've tried to get the text, but none work: #include <GuiListView.au3> local $result, $idListWindow, $idListView, $hWnd, $hWndCtrl $idListWindow="[CLASS:WindowsForms10.Window.8.app.0.b71fd5_r8_ad1]" $idListView="[CLASSNN:WindowsForms10.Window.8.app.0.b71fd5_r8_ad12]" $hWnd = WinGetHandle($idListWindow) $hWndCtrl = ControlGetHandle($idListWindow, "", $idListView) ;confirm I am working with the right window/control ConsoleWrite("hWnd: " & $hWnd & @LF) ConsoleWrite("hWndCtrl: " & $hWndCtrl & @LF) ;method 1 $result = ControlListView("", "", $idListView, "GetText", 0, 1) ConsoleWrite("method 1: "& $result & @LF) ;method 2 $aItem = _GUICtrlListView_GetItemTextArray($idListview, 0) For $i = 1 To $aItem[0] $result = StringFormat("Column[%2d] %s", $i, $aItem[$i]) & @CRLF Next ConsoleWrite("method 2: "& $result & @LF) ;method 3 $result = ControlGetText("" ,"",$hWndCtrl) ConsoleWrite("method 3: "& $result & @LF) The handle of the main window are correct. Unfortunately, none of these 3 methods seem to work. Output I get is: hWnd: 0x003C0A60 hWndCtrl: 0x00610B6C method 1: 0 method 2: 0 method 3: >Exit code: 0 Time: 0.8224 What can I use to be able to get text from this WindowsForms10.Window.8.app.0.b71fd5_r8_ad12 control? Thanks!
Zedna Posted November 13, 2021 Posted November 13, 2021 Search this forum for "WindowsForms" ... Resources UDF ResourcesEx UDF AutoIt Forum Search
greg_ward02 Posted November 13, 2021 Author Posted November 13, 2021 1 hour ago, Zedna said: Search this forum for "WindowsForms" ... Hi Zedna, Can you be a little more specific? I searched and it seems to be too broad of a term.
Zedna Posted November 13, 2021 Posted November 13, 2021 (edited) Windows Forms are specific type of windows/controls and there are specific techniques/UDFs for them and it is very often answered question here on the forum. Edited November 13, 2021 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
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