Cannot access Button Control : Automation API

Cannot access Button Control

Class library usage, coding and language questions.

Cannot access Button Control

Postby ranettix » Tue Oct 27, 2009 12:20 am

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
ranettix
 
Posts: 20
Joined: Mon Aug 28, 2006 1:07 pm

Re: Cannot access Button Control

Postby Support Team » Tue Oct 27, 2009 10:55 am

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
User avatar
Support Team
Site Admin
 
Posts: 4289
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: Cannot access Button Control

Postby ranettix » Wed Oct 28, 2009 6:56 pm

Since it is the 3rd instance, I took 3, which failed. 4 does work.
ranettix
 
Posts: 20
Joined: Mon Aug 28, 2006 1:07 pm

Re: Cannot access Button Control

Postby Support Team » Thu Oct 29, 2009 10:13 am

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
User avatar
Support Team
Site Admin
 
Posts: 4289
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria


Return to Automation API

Who is online

Users browsing this forum: No registered users and 0 guests