Marcin
Marcin

Reputation: 1276

Is it possible to screenshot a minimized application

I know it's possible to capture a screen of an application that is behind another application, but I can't seem to find anything on capturing the screen of a minimized application.

Anyone happen to know if this is possible? I don't want to get into things like maximizing and minimizing the application really quick.

Upvotes: 5

Views: 3797

Answers (7)

Wocugon
Wocugon

Reputation: 586

I know its too late, maybe it might help others.

I thought of a different approach, instead of minimizing, I moved my form outside my screen co-ordinates before capturing the screen and later respawned it. Below is my code example:

//Move the form beyond the screen
this.StartPosition = FormStartPosition.Manual;
      this.Location = new Point(Screen.PrimaryScreen.Bounds.Width + 10, Screen.PrimaryScreen.Bounds.Height + 10);

// Screenshot code here...

//Respawn the form to origin location
this.Location = currentPosition;

Upvotes: 0

Gabe Miller
Gabe Miller

Reputation: 132

If anyone still wants to no a workable solution I tried this one and worked well for me. It does a trick for minimized windows (because windows does not refresh them, on the taskbar the iconic picture shows the last image of the window before it was minimized). And Ziplin above mentioned that Objectdock can capture minimized windows, actually it does the same as Windows, it uses the last image captured before minimizing.

So here is the link: http://www.codeproject.com/Articles/20651/Capturing-Minimized-Window-A-Kid-s-Trick

Upvotes: 1

anon
anon

Reputation:

As a last resort: why not capture window just before it gets minimized?

Upvotes: 0

Manfre
Manfre

Reputation: 1245

You can't without restoring the window. When a window is minimized, the application is not in a state to render a UI for your application to capture.

Upvotes: 1

µBio
µBio

Reputation: 10758

As @ziplin said with newer version of windows it may be possible (via DWM apis). From c# you can use the Windows API codepack to access the new apis

Upvotes: 4

Donnie
Donnie

Reputation: 46933

I've never tried it. This code claims looks reasonable, but has caveats about minimized windows. It is, if nothing else, a place to start.

Upvotes: 0

Dlongnecker
Dlongnecker

Reputation: 3047

I don't believe so, simply because i've noticed programs that try to preview a window that is minimized seem to draw a blank on occasion if the window is minimized. Although, some new versions of windows (vista and 7, I believe) do this very thing, but I'm not sure how easy it is to replicate (at all)

: http://www.stardock.com/products/objectdock/

Upvotes: 1

Related Questions