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!