Can't Find that Button! (SOLVED)

General discussion about the Phantom Automation Language and related tools.

Can't Find that Button! (SOLVED)

Postby SpiritualMadMan on Fri Feb 25, 2011 6:39 pm

I wanted to pass this on and give all a chance to enjoy it. :)

I am automating code that uses lots of Custom Controls and lots of the same controls with no unique name.

(Counting down 22 times to get to a control is a big pain!)

But, that's not PTD's fault.

So, I started just giving up and using the Base Window co-ordinates to Mouse Click a given Button.

In this case it was the "ON" Button for a Function Generator.

Unfortunately, the Base Window got resized.

Oh, it wasn't a big enough change to be "seen", by me...

But, it now placed my "ON" Mouse Click over the "OFF" button!

So, I bit the bullet and started doing a search and destroy in the Declarations File looking for that elusive Button...

Scanning with the declarations recorder indicated that the button was "under" the Tab Control.

So, I went through every AfxWndCtrl401 Control under the Tab Control using GetText() with no success.

So, I tried again with MouseClick(0,5,5,0) (followed immediately by an EXIT, this allows you to "see" where the MouseClick occurred). Still No Luck.

Then, "!Finally!", I noticed that there was an AfxWndCtrl401 Control "above" the Tab Control...

It expanded into three AfxWndCtrl401's and they ended up being the Buttons I needed.

So, the moral of this story is, that even when the PTD Windows Declaration Recorder "seems" to show you a Button is "under" a given control...

It may actually be "above" that control.

Happy Hunting! :)
SpiritualMadMan
 
Posts: 20
Joined: Mon Dec 06, 2010 4:02 pm

Re: Can't Find that Button! (SOLVED)

Postby SpiritualMadMan on Tue Mar 01, 2011 1:32 pm

Hopefully, not a duplicate post as I seemed to have clicked the draft vs saved and lost my post...

Noticed something "interesting" late yesterday in that if I execute Switching.SSTabCtl.Wnd.Class1.AfxWnd408.AfxWnd401.MouseClick(0,15,15,0); on any Tab Page EXCEPT the one the control actually resides on, the Mouse Pointer goes "off window".

If I execute Switching.SSTabCtlWnd.Class1.AfxWnd408.AfxWnd401.MouseClick on the Correct Tab Page the Mouose Pointer goes to the correct control.

My Switching window was programmed by persons unknown and is believed to be made up of National Instruments Lab View Custom Controls.

At the first level under the SSTabCtlWndClass1 I have AfxWnd403 through AfxWnd4035, each of which has an AfxWnd401 under it NONE of which has any unique identification as to where, what or what it does!

Nor, where they added to the window in ANY logical order, rhyme or reason!


At least with this method I have been able to identify my Switches and the Tab Page they are on.

Happy Hunting! :)
SpiritualMadMan
 
Posts: 20
Joined: Mon Dec 06, 2010 4:02 pm


Return to Phantom

Who is online

Users browsing this forum: No registered users and 1 guest

cron