Ranorex

Find window with title and class name?

 
Post new topic   Reply to topic    Ranorex Forum Index -> General Questions
View previous topic :: View next topic  
Author Message
bszot



Joined: 22 Jul 2006
Posts: 3

PostPosted: Sun Feb 18, 2007 10:28 pm    Post subject: Find window with title and class name?
Can a window be searched with title and class name?
We have sometimes more than one application with the same title but with different class names.

Thanks

Ben
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 05 Jul 2006
Posts: 351

PostPosted: Tue Feb 20, 2007 12:44 am    Post subject:
We have already implemented the function FormFind(title and className) for the next release V1.1.0.
Please search the window in V1.0.0 as follows:

Code: click into code to enlarge
Form form = null;
Application.GetForms();
foreach (Form topform in Application.Forms)
{
    if( topform.Text == "title" && topform.ClassName == "className")
    {
        form = topform;
        Console.WriteLine("Handle={0} Location={1} Text={2} ClassName={3}",
                               form.Handle, form.Location, form.Text, form.ClassName);
   break;
    }
}

Jenö
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Ranorex Forum Index -> General Questions All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum