08-22-2009, 02:12 PM
another way
Macro Macro807
Macro Macro807
out
;find accessible object of listview control (in the example I use QM My Macros dialog, change it)
int w1=win(" - My Macros - All Programs" "#32770")
Acc ao=acc("" "LIST" w1 "SysListView32" "" 0x1000)
;get item count
int n=SendMessage(child(ao) LVM_GETITEMCOUNT 0 0)
;store elem of all items with certain description to array a (in the example I use "*0" as description, change it)
ARRAY(int) a
int i
for i 0 n
,ao.elem=i+1
,str sd=ao.Description
,;out sd
,if(!matchw(sd "*0")) continue
,a[]=ao.elem
out "found %i matching items" a.len
;randomize the array
a.shuffle
;now select items. The code selects different item every 1 s.
act w1
for i 0 a.len
,ao.elem=a[i]
,out ao.Name
,ao.Select(SELFLAG_TAKEFOCUS|SELFLAG_TAKESELECTION)
,1