Posts: 86
Threads: 27
Joined: Jan 2008
I think it can be done but i just cant get it
how can i make an acc, like when you find acc not a acc action = and int
int b=Acc a=acc(
that doesn't seem to work but thats pretty much what i want to do
If anyone could show me an example i would appreciate it
Thanks
Posts: 1,000
Threads: 253
Joined: Feb 2008
I think you have to do a Get* (i.e. location, name, value, role, state...) Then you'll be able to play around with the data...
for example:
Acc a=acc("Check" "CHECKBUTTON" win("Dialog" "#32770") "Button" "" 0x1001)
int state=a.State(0)
out state
If the check box is checked you get "16" when you out int state, unchecked you get 0.
I'm no expert at this stuff...but that's at least what I've figured out for tonight myself.
Posts: 12,071
Threads: 140
Joined: Dec 2002
Acc a=acc(...)
str s=a.Name ;;or Value
int i=val(s)
Posts: 86
Threads: 27
Joined: Jan 2008
That doesn't seem to work because after i want to use a
SendMessage code and i need that int for it
Posts: 12,071
Threads: 140
Joined: Dec 2002
Do you need window (control) handle?
Acc a=acc(...)
int hwnd=child(a)
SendMessage hwnd ...
Posts: 86
Threads: 27
Joined: Jan 2008
that is very close
what i am trying to click without mouse is a column header of a Paint Program
the column headers are Colors, Transparency, Brushes, etc...
i want to click Brushes
Acc a=acc("Brushes" "COLUMNHEADER" win("PaintShopPro" "#32770") "SysHeader32" "" 0x1101 654 61)
int b=child(a)
SendMessage(b WM_LBUTTONDOWN 1 0)
SendMessage(b WM_LBUTTONUP 0 0)
that is my code, but the problem is it clicks the first column header, colors, it clicks it every time
im not sure why
do you think you could help fix that code?
Thanks
Posts: 12,071
Threads: 140
Joined: Dec 2002
Default action of COLUMNHEADER usually is Click.
Example with Windows Explorer:
Macro
act "mp3" ;;the window must be active or DoDefaultAction will not work
Acc a=acc("Album" "COLUMNHEADER" win("mp3" "CabinetWClass") "SysHeader32" "" 0x1001)
a.DoDefaultAction
Posts: 12,071
Threads: 140
Joined: Dec 2002
This works with inactive window.
Macro
Acc a=acc("Album" "COLUMNHEADER" win("mp3" "CabinetWClass") "SysHeader32" "" 0x1001)
int x y w h
a.Location(x y w h)
int b=child(a)
ScreenToClient b +&x
x+w/2; y+h/2 ;;center
int xy=(x&0xffff)|(y<<16)
SendMessage(b WM_LBUTTONDOWN 1 xy)
SendMessage(b WM_LBUTTONUP 0 xy)
Posts: 86
Threads: 27
Joined: Jan 2008
Thanks so much Gin
The second one was perfect