Jump to content

Recommended Posts

Posted

Hi, i have some trouble with this simple script:

$Title = "[CLASS:WindowsForms10.window.8.app.0.378734a]"
$listview_test = "[CLASS:WindowsForms10.window.8.app.0.378734a4]"
$ItemsNo = ControlListView ($Title,"",$listview_test,"GetItemCount")
MsgBox(1,"Item Selected ", $ItemsNo)

The value returns 0 while there are actually 14 items in the list. What am i doing wrong?

Doesn't AutoIt work with the List view of Windows Forms?

Posted

Try it this way, and post what you get:

#Include <GuiListView.au3>

Global $Title = "[CLASS:WindowsForms10.window.8.app.0.378734a]"
Global $listview_test = "[CLASS:WindowsForms10.window.8.app.0.378734a4]"

Global $hWnd = WinGetHandle($Title)
ConsoleWrite("$hWnd = " & $hWnd & @LF)

Global $hLV = ControlGetHandle($hWnd, "", $listview_test)
ConsoleWrite("$hLV = " & $hLV & @LF)

Global $ItemsNo = _GUICtrlListView_GetItemCount($hLV)
ConsoleWrite("$ItemsNo = " & $ItemsNo & @LF)

:mellow:

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
Posted

Is that "4" on the end of the control ID actually part of the class name, or an instance number? Maybe it was supposed to be:

"[CLASSNN:WindowsForms10.window.8.app.0.378734a4]"

Or:

"[CLASS:WindowsForms10.window.8.app.0.378734a; INSTANCE:4]"

:mellow:

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
Posted

It's indeed instance number 4, so i changed the code, getting the following output:

$hWnd = 0x00020A6E

$hLV = 0x00030A82

$ItemsNo = 0

But at the moment of running the script, there are actually 22 items in that list as i've counted by hand.

Posted (edited)

#Include <GuiListView.au3>

Global $Title = "[CLASS:WindowsForms10.window.8.app.0.378734a]"
Global $listview_test = "[CLASS:WindowsForms10.window.8.app.0.378734a; INSTANCE:4]"

Global $hWnd = WinGetHandle($Title)
MsgBox(0, "Test", "$hWnd = " & $hWnd & @LF)

Global $hLV = ControlGetHandle($hWnd, "", $listview_test)
MsgBox(0, "Test", "$hLV = " & $hLV & @LF)


Global $ItemsNo = _GUICtrlListView_GetItemCount($hLV)
MsgBox(0, "Test", "$ItemsNo = " & $ItemsNo & @LF)

This code leads to:

$hWnd = 0x00020A6E

$hLV = 0x00030A82

$ItemsNo = 0

So that's the function _GUICtrlListView_GetItemCount()

Edited by ultim
Posted

I used to work with AutoHotkey, which didn't support it.

Then i moved to AutoIt for getting around this specific problem... so it seems this is going to be a dead end also :mellow:

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