Jump to content

_GUICtrlListView_GetItemTextArray i can't read items


Recommended Posts

Hi, i have a problem,

i can't retrive all items from list:

$win ="Optimus64"
$iListView=ControlGetHandle ($win, "","SysListView32")
$array=_GUICtrlListView_GetItemTextArray ($iListView)

_GUICtrlListView_GetItemTextArray retrive an array with 23 elements but blank.

 

why?

i can retrive all item with select all and copy with Send("^c") but is very orrible

thanks

 

Console Browse: Navigate on the WEB in a textual consoleMultiPing!: Show computer on the lan and/or show the local/remote task, ALL animated!KillaWin: Event executingCryptPage: Crypt your webpage and show only with key
Link to post
Share on other sites
On 12/4/2021 at 12:55 PM, Cyber said:

Hi, i have a problem,

i can't retrive all items from list:

$win ="Optimus64"
$iListView=ControlGetHandle ($win, "","SysListView32")
$array=_GUICtrlListView_GetItemTextArray ($iListView)

_GUICtrlListView_GetItemTextArray retrive an array with 23 elements but blank.

 

why?

i can retrive all item with select all and copy with Send("^c") but is very orrible

thanks

 

i hope this help ya :)

#include <GuiListView.au3>
#RequireAdmin
$instance = 1
$win = "Optimus64"
_RetrieveItems($win,"","SysListView32",$instance)
 ;;
 ;;Made by Ad777
 ;FuncName:_RetrieveItems
 ;Param:
 ;$wintitle:The title/hWnd/class of the window to move/resize. See Title special definition.
 ;$text;The text of the window to move/resize. See Text special definition.
 ;$controlid:The control to interact
 ;$instance:instance of Class
 ;;
Func _RetrieveItems($wintitle,$text,$controlid,$instance)
   Global $inc
   Local $Item,$Combine
    For $ii = 0 to 400
    $Item = _GUICtrlListView_GetItemTextArray(ControlGetHandle($wintitle,$text,$controlid&$instance), $ii)
    For $i = 1 To $Item[0]
       $Combine &= $Item[$i] & @CRLF
            if $Item[$i] = "" Then
               Return   MsgBox(64, "",  $Combine&@CRLF&"Count:"&$inc)
            Else
               $inc = $inc+1

       EndIf
    Next
Next
   EndFunc

you can find instance using Autoit Window Info(C:\Program Files\AutoIt3\Au3Info.exe)

https://i.postimg.cc/qqZ4yzcQ/instance.jpg

Edited by ad777

iam ِAutoit programmer.

best thing in life is to use your Brain to

Achieve

everything you want.

Link to post
Share on other sites
8 hours ago, Cyber said:

Thanks, but not work 😔

the handle is correct but nothing return, the element is 23 (is correct) buy empty

can you show me Image of program you use.

iam ِAutoit programmer.

best thing in life is to use your Brain to

Achieve

everything you want.

Link to post
Share on other sites
On 12/6/2021 at 10:15 AM, Cyber said:

Thanks, but not work 😔

the handle is correct but nothing return, the element is 23 (is correct) buy empty

try this code:

#include <File.au3>
#RequireAdmin
Global  $Combine,$strc,$num = 0,$np
Local $wintitle = "Looking for '#32'", $class ="SysListView32" ,$instance ="1" ;
_RetrieveItems2($wintitle,$class,$instance)
Func _RetrieveItems2($wintitle,$class,$instance)
For $i = 0 To ControlListView ( $wintitle, "",$class&$instance, "GetItemCount") Step 1
    $strc = ControlListView ( $wintitle, "",$class&$instance, "GetText", $i, $num)
      if $strc = "" Then

      $num = $num + 1
      $i = 0
      if StringLen($np) = 0 And $strc = "" Then
         ExitLoop
      EndIf
   Else
       $Combine &= ControlListView ($wintitle, "",$class&$instance, "GetText", $i, $num) &@CRLF
      Endif
$np  = $strc
   Next
    Return MsgBox(0,"", $Combine)
EndFunc

 

Edited by ad777

iam ِAutoit programmer.

best thing in life is to use your Brain to

Achieve

everything you want.

Link to post
Share on other sites
  • Moderators

ad777,

For the last time, when you reply in future, please use the "Reply to this topic" button at the top of the thread or the "Reply to this topic" editor at the bottom rather than the "Quote" button - responders know what they wrote and it just pads the thread unnecessarily. Do it again and you get a posting holiday - clear?

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to post
Share on other sites

nothing 

😔

thanks anyway
 

#include <File.au3>
#RequireAdmin
Global  $Combine,$strc,$num = 0,$np
Local $wintitle = "* - MetaTrader 4 Manager", $class ="SysListView32" ,$instance ="17" ;
_RetrieveItems2($wintitle,$class,$instance)
Func _RetrieveItems2($wintitle,$class,$instance)

    MsgBox(0,"",ControlListView ( $wintitle, "",$class&$instance, "GetItemCount"))
For $i = 0 To ControlListView ( $wintitle, "",$class&$instance, "GetItemCount") Step 1
    $strc = ControlListView ( $wintitle, "",$class&$instance, "GetText", $i, $num)
      if $strc = "" Then

      $num = $num + 1
      $i = 0
      if StringLen($np) = 0 And $strc = "" Then
         ExitLoop
      EndIf
   Else
       $Combine &= ControlListView ($wintitle, "",$class&$instance, "GetText", $i, $num) &@CRLF
      Endif
$np  = $strc
   Next
    Return MsgBox(0,"", $Combine)
EndFunc

 

Console Browse: Navigate on the WEB in a textual consoleMultiPing!: Show computer on the lan and/or show the local/remote task, ALL animated!KillaWin: Event executingCryptPage: Crypt your webpage and show only with key
Link to post
Share on other sites

Hi @Cyber,

Does this return anything?

#include <GuiListView.au3>

Local $hWnd = WinGetHandle('* - MetaTrader 4 Manager')
If IsHWnd($hWnd) = 1 Then
    Local $hCtrl = ControlGetHandle($hWnd, '', '[CLASS:SysListView32; INSTANCE:15]')
    Local $iCount = _GUICtrlListView_GetItemCount($hCtrl)
    For $i = 0 To ($iCount - 1) Step 1
        Local $aItems = _GUICtrlListView_GetItemTextArray($hCtrl, $i)
        For $j = 1 To $aItems[0] Step 1
            ConsoleWrite('Item ' & $i & ', SubItem ' & $j & ' - ' & $aItems[$j] & @CRLF)
        Next
    Next
Else
    Exit(1)
EndIf

The WinTitle and ListView instance are based on the information from the image of your AutoIt Window Info Tool.

Link to post
Share on other sites

 

On 12/13/2021 at 2:48 AM, spudw2k said:

@Cyber

Does forcing x64 make a difference?

;Add to beggining of script
#AutoIt3Wrapper_UseX64=Y

 

nothing

 

 

On 12/10/2021 at 2:18 PM, Luke94 said:

Hi @Cyber,

Does this return anything?

#include <GuiListView.au3>

Local $hWnd = WinGetHandle('* - MetaTrader 4 Manager')
If IsHWnd($hWnd) = 1 Then
    Local $hCtrl = ControlGetHandle($hWnd, '', '[CLASS:SysListView32; INSTANCE:15]')
    Local $iCount = _GUICtrlListView_GetItemCount($hCtrl)
    For $i = 0 To ($iCount - 1) Step 1
        Local $aItems = _GUICtrlListView_GetItemTextArray($hCtrl, $i)
        For $j = 1 To $aItems[0] Step 1
            ConsoleWrite('Item ' & $i & ', SubItem ' & $j & ' - ' & $aItems[$j] & @CRLF)
        Next
    Next
Else
    Exit(1)
EndIf

The WinTitle and ListView instance are based on the information from the image of your AutoIt Window Info Tool.

 

Item 0, SubItem 1 - 
Item 0, SubItem 2 - 
Item 0, SubItem 3 - 
Item 0, SubItem 4 - 
Item 0, SubItem 5 - 
Item 0, SubItem 6 - 
Item 1, SubItem 1 - 
Item 1, SubItem 2 - 
Item 1, SubItem 3 - 
Item 1, SubItem 4 - 
Item 1, SubItem 5 - 
Item 1, SubItem 6 - 
Item 3, SubItem 6 - 
Item 4, SubItem 1 - 
Item 4, SubItem 2 - 
Item 4, SubItem 3 - 
Item 4, SubItem 4 - 
Item 4, SubItem 5 - 
Item 4, SubItem 6 -

 

😔

Console Browse: Navigate on the WEB in a textual consoleMultiPing!: Show computer on the lan and/or show the local/remote task, ALL animated!KillaWin: Event executingCryptPage: Crypt your webpage and show only with key
Link to post
Share on other sites

See if this returns anything different.

#include <GuiListView.au3>

Local $hWnd = WinGetHandle('* - MetaTrader 4 Manager')
If IsHWnd($hWnd) = 1 Then
    Local $hCtrl = ControlGetHandle($hWnd, '', '[CLASS:SysListView32; INSTANCE:15; ID:2218]')
    Local $iCount = _GUICtrlListView_GetItemCount($hCtrl)
    For $i = 0 To ($iCount - 1) Step 1
        Local $aItems = _GUICtrlListView_GetItemTextArray($hCtrl, $i)
        For $j = 1 To $aItems[0] Step 1
            ConsoleWrite('Item ' & $i & ', SubItem ' & $j & ' - ' & $aItems[$j] & @CRLF)
        Next
    Next
Else
    Exit(1)
EndIf

 

Link to post
Share on other sites
On 12/14/2021 at 4:35 PM, Luke94 said:

See if this returns anything different.

#include <GuiListView.au3>

Local $hWnd = WinGetHandle('* - MetaTrader 4 Manager')
If IsHWnd($hWnd) = 1 Then
    Local $hCtrl = ControlGetHandle($hWnd, '', '[CLASS:SysListView32; INSTANCE:15; ID:2218]')
    Local $iCount = _GUICtrlListView_GetItemCount($hCtrl)
    For $i = 0 To ($iCount - 1) Step 1
        Local $aItems = _GUICtrlListView_GetItemTextArray($hCtrl, $i)
        For $j = 1 To $aItems[0] Step 1
            ConsoleWrite('Item ' & $i & ', SubItem ' & $j & ' - ' & $aItems[$j] & @CRLF)
        Next
    Next
Else
    Exit(1)
EndIf

 

Item 0, SubItem 1 - 
Item 0, SubItem 2 - 
Item 0, SubItem 3 - 
Item 0, SubItem 4 - 
Item 0, SubItem 5 - 
Item 0, SubItem 6 - 
Item 1, SubItem 1 - 
Item 1, SubItem 2 - 
Item 1, SubItem 3 - 
Item 1, SubItem 4 - 
Item 1, SubItem 5 - 
Item 1, SubItem 6 - 
....

😔

thanks anyway

Console Browse: Navigate on the WEB in a textual consoleMultiPing!: Show computer on the lan and/or show the local/remote task, ALL animated!KillaWin: Event executingCryptPage: Crypt your webpage and show only with key
Link to post
Share on other sites

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...