Can I take snapshot of the my Desktop using Ranorex 1.5

Class library usage, coding and language questions.
Posts: 24
Joined: Tue Apr 14, 2009 12:29 pm

Can I take snapshot of the my Desktop using Ranorex 1.5

Post by balajichandan » Tue Apr 14, 2009 12:41 pm

This is Balaji. Is there a way that I can enumerate all the dialogs available at one point of time. Is there a way to take snapshot of my desktop to see all the windows available at that point of time.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12169
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA

Post by Support Team » Thu Apr 16, 2009 12:53 pm

You can enumerate all currently available top-level forms using the Ranorex.Application.Forms property that returns a list of Form instances.
The desktop itself is a top-level form and its classname is "Progman". So, you can search for that classname and then use the CaptureImage method make a screenshot:

Code: Select all

Form desktop = Application.FindFormClassName("Progman");
Bitmap screenshot = desktop.CaptureImage();
Ranorex Support Team