Jump to content
Sign in to follow this  

Interesting ListView problem/bug?

Recommended Posts

I recently (finally) upgraded my version of AutoIt from to the latest

My problem is with the ControlListView function. My code is as follows:

Func AppliedListView()
        Local $wndTitle = ": "
        Local $wndText = ""
        Local $ctrlList = "ListView20WndClass1"

        $row = ControlListView($wndTitle, $wndText, $ctrlList , "GetItemCount")
        $col = ControlListView($wndTitle, $wndText, $ctrlList , "GetSubItemCount")
        Dim $aList[$row+1][$col+1]

        For $i = 0 To $row
            For $j = 0 To $col 
                $aList[$i][$j] = ControlListView($wndTitle, $wndText, $ctrlList , "GetText", $i, $j)
        Return $aList

The problem is both the following calls work,

ControlListView($wndTitle, $wndText, $list, "GetItemCount")

ControlListView($wndTitle, $wndText, $list, "GetSubItemCount")

however, this does not work with version, yet it does with version

ControlListView($wndTitle, $wndText, $list, "GetText", $i, $j)

Is there any known bugs I'm not seeing with the new version, or any workarounds?

Thanks much,


Share this post

Link to post
Share on other sites

I don't know why that wouldn't work for you, but here is a demo of equivalent functions in the new GuiListView.au3 UDF:

$hList = ControlGetHandle($wndTitle, $wndText, $list)
$iRows = _GUICtrlListView_GetItemCount($hList)
$iCols = _GUICtrlListView_GetColumnCount($hList)
For $i = 0 To $iRows - 1
    For $j = 0 To $iCols - 1
        $sText = _GUICtrlListView_GetItemText($hList, $i, $j)
        ConsoleWrite("Debug: ListView [" & $i & "][" & $j & "] = " & $sText & @LF)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...