Jump to content

How to access to a list in a TAdvTreeView control ?


 Share

Recommended Posts

Hi,

How to access to a list of items in a TAdvTreeView control ?

(like on the left side of the attachment image) :

Want to know how many lines in this control

and want to select randomly one of them...

Idem,

How to access to a list of items in a TAdvListView control ?

(like on the right side of the attachment image)

Thanks !

Alain Lioret

(novice in Auto It)

post-60200-12849784618404_thumb.jpg

Link to comment
Share on other sites

You can try ControlCommand() on it. See the help file.

You also might try the _GuiCtrlTreeView_*() functions of the GuiTreeView.au3 UDF. See the help file.

Same answer for the list view, but with _GuiCtrlListView_*() for the UDF functions. See the help file.

If the control was not drawn by the standard Windows APIs, you might be out of luck.

;)

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

Ok

I try this :

Run("C:\Program Files\Ultra Fractal 5\uf5.exe")

WinWaitActive("Ultra Fractal")

Send("^n")

WinWaitActive("Select Formula")

$v = ControlCommand("Select Formula", "", "133730", "GetLineCount", "")

MsgBox(4160, "Information", "Count: " & String($v))

Syntax seems to be ok, but : the ID of the Control is never the same !?

So,

HOW to know the ID of a Control during a script execution ?

Thanks Again

Alain

Link to comment
Share on other sites

Try the CLASS/INSTANCE. Something like:

$v = ControlCommand("Select Formula", "", "[CLASS:TAdvTreeView; INSTANCE:1]", "GetLineCount", "")

Use the AutoIt Window Info Tool (AU3Info.exe) to get the exact class name and instance.

;)

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

Here it is :

----------------------------------------------------------

>>>> Window <<<<

Title: Select Formula

Class: TBrowseForm

Position: 84, 135

Size: 1440, 848

Style: 0x16CC0000

ExStyle: 0x00010500

Handle: 0x00030AFC

>>>> Control <<<<

Class: TAdvListView

Instance: 1

ClassnameNN: TAdvListView1

Name:

Advanced (Class): [CLASS:TAdvListView; INSTANCE:1]

ID: 133968

Text:

Position: 493, 39

Size: 934, 545

ControlClick Coords: 715, 271

Style: 0x56211248

ExStyle: 0x00000200

Handle: 0x00020B50

>>>> Mouse <<<<

Position: 1298, 488

Cursor ID: 2

Color: 0xFFFFFF

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<

Cancel

Open

comment {

Formulas for Ultra Fractal 2.0 by Mark Townsend

Last update on 14 May 2000

}

Mes documents\Ultra Fractal 5\Formulas\Public\mt.ufm

Mes documents\Ultra Fractal 5\Formulas\Public\mt.ufm

>>>> Hidden Text <<<<

Fractal Formulas

--------------------------------------------------------------

Hope it can help you to find something....

Thanks again

Alain

Link to comment
Share on other sites

The right control is :

>>>> Window <<<<

Title: Select Formula

Class: TBrowseForm

Position: 84, 135

Size: 1440, 848

Style: 0x16CC0000

ExStyle: 0x00010500

Handle: 0x00030AFC

>>>> Control <<<<

Class: TAdvListView

Instance: 1

ClassnameNN: TAdvListView1

Name:

Advanced (Class): [CLASS:TAdvListView; INSTANCE:1]

ID: 133968

Text:

Position: 493, 39

Size: 934, 545

ControlClick Coords: 231, 276

Style: 0x56211248

ExStyle: 0x00000200

Handle: 0x00020B50

>>>> Mouse <<<<

Position: 814, 493

Cursor ID: 2

Color: 0xFFFFFF

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<

Cancel

Open

comment {

Formulas for Ultra Fractal 2.0 by Mark Townsend

Last update on 14 May 2000

}

Mes documents\Ultra Fractal 5\Formulas\Public\mt.ufm

Mes documents\Ultra Fractal 5\Formulas\Public\mt.ufm

>>>> Hidden Text <<<<

Fractal Formulas

NB : you can download a demo version of ultrafractal to test my script at : www.ultrafractal.com

My script is :

Run("C:\Program Files\Ultra Fractal 5\uf5.exe")

WinWaitActive("Ultra Fractal")

Send("^n")

WinWaitActive("Select Formula")

$v = ControlCommand("Select Formula", "", "TAdvTreeView1", "GetLineCount", "")

MsgBox(4160, "Information", "Count: " & String($v))

Alain

Link to comment
Share on other sites

You can try this for more precision:

$v = ControlCommand("[CLASS:TBrowseForm; TITLE:Select Formula]", "", "[CLASS:TAdvListView; INSTANCE:1]", "GetLineCount", "")
But I suspect you are completely out of luck.

The GUI class of TBrowseForm is from a Delphi library, and they draw their own custom controls without the standard Windows APIs. This has come up before with things like Delphi Grid controls. No solution I'm aware of for talking to those controls with AutoIt.

;)

Edit: Perhaps you can skip the GUI and go more direct. If you know where those files are kept, you could just get a count directly from the FileSystem.

:)

Edited by PsaltyDS
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...