Jump to content
Sign in to follow this  

Problem with ListView (CLASS:ListView20WndClass)

Recommended Posts

I'm trying to create a script to automate a process.

Here I have to use a existing screen from our softwarevendor.

In that screen there is a listview of the [CLASS:ListView20WndClass; INSTANCE:1]

Now some commands from AutoIt do work with this listview


when I use the select,the getitemcount, the getsubitemcount of the controlListView => I get the right result

when I use the Gettext of teh controllistview => I don't get a result (I get a blank result)

I've also tried the controlcommand with no success

I there anywhone you used a script with the CLASS:ListView20WndClass?

How did you get the text of the items in that list?

What can I try to get the text of all the items in that list?



Share this post

Link to post
Share on other sites

No I didn't

I'm new to AutoIt so I have to use the help-file for finding solutions to my problems.

I can't find those functions in the autoit.chm

O now I see it, I have to read the UDFs3.chm

Thanks I will take a look at that

Share this post

Link to post
Share on other sites

Are the handles that you must use for the UDF's (hwnd) the same handles that you get as a result from the WinGetHandle function?

I tried to use the UDF's

_GUICtrlListView_GetItemText _GUICtrlListView_GetItemTextArray _GUICtrlListView_GetItemTextString

but with no result!

The strange thing is that when I use the controlListView with getItemCount or with getSelectedCount or with Select it all works but when I use getText (with or without subItem) I don't get a result?

Is there anyone who knows what can be the reason for that (and why the UDF's _GUICtrlListView also don't work or give me a error so that I can find out what's wrong)

I really want to use those UDF's because you can do interesting stuff with those.

Share this post

Link to post
Share on other sites

As Deathbringer said, the window and control handles are the same variable type, but not the same value. You want something like this:

#include <GuiListView.au3>

; ...

$hWindow = WinGetHandle("Your Window Title", "Maybe some window text")
$hListView = ControlGetHandle($hWindow, "", "[CLASS:ListView20WndClass; INSTANCE:1]")
$iItemCnt = _GUICtrlListView_GetItemCount($hListView)
$iColCnt = _GUICtrlListView_GetColumnCount($hListView)
For $i = 0 To $iItemCnt - 1
    ConsoleWrite("Item: " & $i & @LF)
    For $c = 0 To $iColCnt - 1
        $sText = _GUICtrlListView_GetItemText($hListView, $i, $c)
        ConsoleWrite(@TAB & "Col: " & $c & " = " & $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...