Jump to content

Problem with ListView (CLASS:ListView20WndClass)


DenDuze
 Share

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

example:

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?

Regards

Didier

Link to comment
Share on other sites

Did you try this?

_GUICtrlListView_GetItemText
_GUICtrlListView_GetItemTextArray
_GUICtrlListView_GetItemTextString

Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe
trying to produce bigger and better idiots.
So far, the Universe is winning.

Link to comment
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.

Link to comment
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)
    Next
Next

:x

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
Link to comment
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
 Share

  • Recently Browsing   0 members

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