Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using Acc Objects error?
#10
another way
Macro Macro807
Code:
Copy      Help
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


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)