Page 1 of 1

Change values in listview

Posted: 16 Jun 2019, 12:19
by hengel
Hi, I'm just starting with AutoHotkey and I don't understand how to get and set values in a listview of another application.

The listview looks like:
Header Value
zone true
time 1600
factor 1.5

I can get the values into SelectedItems with this:
ControlGet, SelectedItems, List,, SysListView321, Format Strategy

But then I would like to check the value of row 1 and column 2 (zone=true). If it is true I want to change the value to false. And then do similar checks with row 3/column 2 and row 4/column as well (check value and then set it to something new)-

Any tips how this should be done, please?

Re: Change values in listview  Topic is solved

Posted: 17 Jun 2019, 17:32
by rommmcek
You are near, for the first part.

Code: Select all

ControlGet, ColItems, List, col3, SysListView321, Format Strategy
;MsgBox % colItems
loop, parse, colItems, `n
{
    if (A_Index = 2) {
        col3row2:=A_LoopField
        break
    }
}
MsgBox % col3row2
I think, more directly would be via sending a message LVM_GETITEMTEXT.
That way you could later even send a message LVM_SETITEMTEXT.
However sending a message requires knowledge how to get/set info from/to a
struct
, which I can't.
Maybe some one else will help you (and me too - to learn)!

Re: Change values in listview

Posted: 18 Jun 2019, 06:52
by teadrinker
But what's the point to change the values in the window of another application? The values themselves won't change, only the text in the window will change.

Re: Change values in listview

Posted: 18 Jun 2019, 07:16
by garry
I tried some listview examples , add/modify/delete , print/calculate/formatted text ...
cn
https://www.autohotkey.com/boards/viewtopic.php?f=28&t=3384
pt
https://www.autohotkey.com/boards/viewtopic.php?f=69&t=63445

Re: Change values in listview

Posted: 29 Jun 2019, 13:43
by jeeswg
There's an LVSetText function, in this library, which works on external GUIs, however, I only really use it for internal GUIs:
GUIs via DllCall: text functions (get/set internal/external control text) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=40514