Jump to content

Recommended Posts

Posted

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: 

0?ui=2&ik=1e96154947&attid=0.2&permmsgid=msg-f:1716324288450278647&th=17d19bd8cc7434f7&view=fimg&fur=ip&sz=s0-l75-ft&attbid=ANGjdJ-qyOhryYLojrOgcbO5LFw8WFnS2rT_U_Lzq0lWyK3SZDn9cAA2sm2vhRA18BhwOoInCrZTr0Z4-2nHXLGFpHGMVkhkiegW1TbmdwcIMSqrFIH-3b8goF-Myrw&disp=emb

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:

0?ui=2&ik=1e96154947&attid=0.1&permmsgid=msg-f:1716324288450278647&th=17d19bd8cc7434f7&view=fimg&fur=ip&sz=s0-l75-ft&attbid=ANGjdJ9Qja0i4Uc1TcQ1SMyqhRCM5DLYcEbNxzkV9Q5KnkhKmywjjZ88wErmGovOIl7Qz4w4vlFP6fQdrTw4fLpmUCdtlsdaIn_5AzBPYePA9ggjCGgMrpfR7YLVdDI&disp=emb

 

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!

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...