Change values in listview Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
hengel
Posts: 1
Joined: 16 Jun 2019, 12:10

Change values in listview

16 Jun 2019, 12:19

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?
User avatar
rommmcek
Posts: 1474
Joined: 15 Aug 2014, 15:18

Re: Change values in listview  Topic is solved

17 Jun 2019, 17:32

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)!
teadrinker
Posts: 4326
Joined: 29 Mar 2015, 09:41
Contact:

Re: Change values in listview

18 Jun 2019, 06:52

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.
garry
Posts: 3763
Joined: 22 Dec 2013, 12:50

Re: Change values in listview

18 Jun 2019, 07:16

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
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Change values in listview

29 Jun 2019, 13:43

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
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Lamron750 and 369 guests