How to screen capture a disconnected remote desktop?

I wrote a small Java app that capture the screen ans sends it by email.

I logged on using remote desktop to a Windows XP Pro server and ran the application.
While I am logged on to the server I recieve the good screencaptures to my email.

When I disconnect from the server without ending the session I keep getting emails but the images are black / blank.

I tried capturing the screen by emulating a PRTSCR key or by Robot.captureScreen but with no luck.

I would like to get print screens even when I am disconnected from the server. Is there a way to config Windows so it will not turn off display when I disconnect?
ElishaMosheAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
ElishaMosheConnect With a Mentor Author Commented:
I did not find a solution to my question but I did find a solution to my problem.

As my application is a Java app instead of using Windows Print Screen I can use Swing abilities to capture the screen.


GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice gd = ge.getDefaultScreenDevice();
GraphicsConfiguration gc = gd.getDefaultConfiguration();
 
BufferedImage bImage = gc.createCompatibleImage(component.getWidth(), component.getHeight(), Transparency.OPAQUE);
Graphics2D g = bImage.createGraphics();
component.paint(g);

Open in new window

0
 
milduraitCommented:
I'd suggest that RDP being a service would be conserving resources by not producing screen data for disconnected sessions. You could try logging in using the console or admin switches and see if your code works.

eg mstsc /console
     mstsc /admin

(Depending on your version of RDP client).

0
 
ElishaMosheAuthor Commented:
Thanks for the reply.

I am connecting from a Windows XP Home SP3.
I tried with "mstsc /admin" (I saw that I have this switch using "mstsc /?") but with no luck.
0
All Courses

From novice to tech pro — start learning today.