Jump to content

Recommended Posts

Posted (edited)

Hi i try to put the last item text of a listview in a variable is are my code

WinWaitActive("My Prog Name")
    ControlListView ( "My Prog Name", "", 771, "SelectAll")
    $Lget = ControlListView ( "My Prog Name", "", 771, "GetItemCount")
    ControlListView ( "My Prog Name", "", 771, "SelectClear")
    $Lfind = ControlListView ( "My Prog Name", "", 771, "GetText", $Lget)

oh and by the way i know already for title i have just put my prog name as a example and my code did not work and the code is on a function

Any suggestion please ?

Thank you

Best regards

Edited by manofman
Posted

Hi i try to put the last item text of a listview in a variable is are my code

WinWaitActive("My Prog Name")
    ControlListView ( "My Prog Name", "", 771, "SelectAll")
    $Lget = ControlListView ( "My Prog Name", "", 771, "GetItemCount")
    ControlListView ( "My Prog Name", "", 771, "SelectClear")
    $Lfind = ControlListView ( "My Prog Name", "", 771, "GetText", $Lget)

oh and by the way i know already for title i have just put my prog name as a example and my code did not work and the code is on a function

Any suggestion please ?

Thank you

Best regards

I'm not in Windows land right now, so I can't test easily (could bring up WINE but I'm lazy). The index to ListView items is zero-based, I believe. That means you need to use $Lget - 1 for the last item.

:)

^_^

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 (edited)

I'm not in Windows land right now, so I can't test easily (could bring up WINE but I'm lazy). The index to ListView items is zero-based, I believe. That means you need to use $Lget - 1 for the last item.

:)

^_^

ok thx i wll test it

EDIT: seems that does not work always blank with my msg box to see if its work

Edited by manofman
Posted (edited)

Any other idea ???

here my new code :

WinWaitActive("My Prog Name")
    ControlListView ( "My Prog Name", "", 771, "SelectAll")
    $Lget = ControlListView ( "My Prog Name", "", 771, "GetItemCount")
$findit = $Lget - 1
    ControlListView ( "My Prog Name", "", 771, "SelectClear")
    $Lfind = ControlListView ( "My Prog Name", "", 771, "GetText", $Lget)

all variable are set global

Edited by manofman
Posted

Any other idea ???

I have AutoIt loaded under WINE here, and it's not a current version. I think you need to look at the newer UDF functions under _GuiCtrlListView_* in the help file for 3.2.10.0. Sorry I can't follow you there at the moment, but I think that's where you'll find the answer.

:)

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

I have AutoIt loaded under WINE here, and it's not a current version. I think you need to look at the newer UDF functions under _GuiCtrlListView_* in the help file for 3.2.10.0. Sorry I can't follow you there at the moment, but I think that's where you'll find the answer.

:)

ok thank you
Posted

Not enough code for me...but

$Item_Count = ControlListView ( "My Prog Name", "", 771, "GetItemCount")

$Lfind = ControlListView ( "My Prog Name", "", 771, "GetText", $Item_Count)

per help ...

"GetText", Item, SubItem Returns the text of a given item/subitem.

Your use just doesn't make sense to me

8)

NEWHeader1.png

Posted (edited)

Not enough code for me...but

$Item_Count = ControlListView ( "My Prog Name", "", 771, "GetItemCount")

$Lfind = ControlListView ( "My Prog Name", "", 771, "GetText", $Item_Count)

per help ...

"GetText", Item, SubItem Returns the text of a given item/subitem.

Your use just doesn't make sense to me

8)

ok thank you i will try with that

and sorry did not sleep so i have i make some error because of that lol

Edited by manofman
Posted

but to explain better if i have example 10 item on a list box and i want to get the 10th item text

i need to use

ControlListView ( "My Prog Name", "", 771, "GetText", the 10th number of the list box)

Or is something else ???

Posted

but to explain better if i have example 10 item on a list box and i want to get the 10th item text

i need to use

ControlListView ( "My Prog Name", "", 771, "GetText", the 10th number of the list box)

Or is something else ???

Because for now its show me always 0 on my msgbox its realy strange
Posted

other question does listview when you look with windows info the class are always listview32 ??? or its can be something else like FCCHH for example

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
×
×
  • Create New...