Page 1 of 1

Recognition of the Class Name

Posted: Wed Aug 16, 2006 7:41 am
by CookieMonster
I made an application in VS2005 to test ranorex, for e.g I couldn't use the Form.FindClassName("Form1") I hade to use Form.FindClassName("WindowsForms10.Window.8.app.0.378734a"). Is there a possibility to make the class name visible?

Thanks
Dan

Posted: Wed Aug 16, 2006 9:22 pm
by webops
The class name you see in RanorexSpy is not the name of the class in your source code.
Handle, Class name and ControlId are old properties of a window.
See also: http://windowssdk.msdn.microsoft.com/en ... 32596.aspx

Use these properties only if you want to automate an old windows application.
In .NET applications the ControlId is different every time you launch the form, so you cannot use this as your identifier. The class name is also dynamically generated.
Use the Control name property to find a control in a .NET application.

See also: http://msdn.microsoft.com/library/defau ... wforms.asp

Jenö Herget
Ranorex Team

Posted: Thu Jul 26, 2007 7:02 am
by puyopuy
Hi admin,

I'm developing a new application using .NET what property should I use for identifier? My new application will support multiple languages, so I cannot use Form Title as identifier?

Thanks
Jeff

Posted: Thu Jul 26, 2007 6:02 pm
by webops
...what property should I use for identifier?
You can use the Name of the Form, we have no Application.FormFindName at the moment, but you can find the Form by Name easily as follows:

Code: Select all

foreach (Form form in Application.Forms) 
{ 
    if (form.Name == "SearchedForm" ) 
    { 
        form.Activate(); 
        break; 
    } 
} 
Jenö
Ranorex Team

Posted: Fri Jul 27, 2007 12:24 am
by puyopuy
Thanks Jenö, you help is much appreciated