Page 1 of 1

Cannot access Button Control

Posted: Mon Oct 26, 2009 11:20 pm
by ranettix
When using the FindChildClassName method, there seems to be a problem with similar class names, as in the following example:

form = RxFormFindTitle("My Title Something", MATCH_FROM_START, TRUE, 1000);
button = RxFormFindChildClassName(form, "TButton #4");
RxMouseMoveToControl(button);
RxMouseClickControl(button);

There are several buttons with class name starting with "TButton ..".
Compilation is o.k., but during execution the handle "button" will access only the button
named "TButton #1".

How can I reach "TButton #4" ? :roll:

---------------------------------------------------------------------
Operating System Windows 2000 SP4
Ranorex Pro 1.2, C++
VCExpress 2005, under Windows XP SP3

Re: Cannot access Button Control

Posted: Tue Oct 27, 2009 9:55 am
by Support Team
The RxFormFindChildClassName function does not take the "#4" into account, it just checks for the classname ("TButton"), not the instance number. If you want to find the forth instance of "TButton" in your form, then specify a value for the classInstance argument in that function:
button = RxFormFindChildClassName(form, "TButton", 4); // find "TButton #4"
Regards,
Alex
Ranorex Support Team

Re: Cannot access Button Control

Posted: Wed Oct 28, 2009 5:56 pm
by ranettix
Since it is the 3rd instance, I took 3, which failed. 4 does work.

Re: Cannot access Button Control

Posted: Thu Oct 29, 2009 9:13 am
by Support Team
If you see "TButton #X" (X being a number) in Ranorex Spy, that means it's the Xth instance and you should have to take 'X' as the instance number.

Regards,
Alex
Ranorex Support Team