Posts: 6
Threads: 2
Joined: Oct 2004
On the help file regarding ACC, you mentioned that it is slower compared to find Window/Control. Which of the codes above do you believe is better to use? Remember SPEED is very important.
Thank you so much
Posts: 12,087
Threads: 142
Joined: Dec 2002
Case 2, if works, is fastest.
[color=blue]int [/color]hwnd=[color=blue]id[/color](5321 "My Dialog")
[color=blue]if[/color](IsWindowVisible(hwnd)) [color=blue]but [/color]hwnd
acc usually also is fast enough, except with some programs. When you capture an object, and click Test button, you can see time spent while searching. For most objects it is 0 - 10 ms, but with some objects can be several seconds.
Posts: 6
Threads: 2
Joined: Oct 2004
ACC is pretty fast on the program I am using. The only problem I am having is getting the ID so I can use the BUT command so it will be identical to Code2. I like using ACC because it minimizes the length of the macro. With Code2 below, I have to declare each individual IDs and check on each individual control, while ACC is a one-liner. I have 10 controls, so you can imagine the difference on size.
Thanks!
Posts: 12,087
Threads: 142
Joined: Dec 2002
You don't need button id.
a.DoDefaultAction
or
but child(a.a)
Or, try to use single function child() to find visible button. You need to include button style, which is different for visible and invisible controls.
int hwnd=child("" "AfxWnd42s" "My Dialog" 128 style)
but hwnd
Here 128 is flag that tells to interpret x as style. Control style is displayed in QM status bar, second line.
Posts: 6
Threads: 2
Joined: Oct 2004
Thanks!
That worked great!
Posts: 6
Threads: 2
Joined: Oct 2004
Gintaras Wrote:Or, try to use single function child() to find visible button. You need to include button style, which is different for visible and invisible controls.
int hwnd=child("" "AfxWnd42s" "My Dialog" 128 style)
but hwnd
Here 128 is flag that tells to interpret x as style. Control style is displayed in QM status bar, second line.
I did the following:
int hwnd=child("" "AfxWnd42s" "My Dialog" 128 0x58000004)
but hwnd
and gave me "missing last argument error." What did I miss?
Posts: 12,087
Threads: 142
Joined: Dec 2002
I forgot it in example. Just add 0.
int hwnd=child("" "AfxWnd42s" "My Dialog" 128 0x58000004 0)
but hwnd
Posts: 6
Threads: 2
Joined: Oct 2004
Now we're talkin :lol:
Thank you very much!