Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ACC vs DLL Function
#1
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
#2
Case 2, if works, is fastest.

Code:
Copy      Help
[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.
#3
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!
#4
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.
#5
Thanks!

That worked great!
#6
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?
#7
I forgot it in example. Just add 0.

int hwnd=child("" "AfxWnd42s" "My Dialog" 128 0x58000004 0)
but hwnd
#8
Now we're talkin :lol:


Thank you very much!


Forum Jump:


Users browsing this thread: 1 Guest(s)