How can I print windows with screen minimization?

How can I print windows with screen minimization? I believe this is possible, since the Windows taskbar can create a window preview, even if it is minimized.

+6
c # printscreen
source share
2 answers

I'm pretty sure this is not possible, at least with an external application like yours. When the application window is minimized, the window cannot (and does not receive) WM_PAINT messages, which means that it is impossible to request that the window redraw itself when it is minimized (or, "take a picture of it"). This is a limitation (or rule) of the Windows API.

The taskbar "circumvents this" by displaying the cached image (which is the last shot that DWM took from the window before drilling it), and therefore it does not actually display the current image of the window. You can verify this by running an application that periodically updates itself and then minimizes it - you will see that the preview image will not be updated until it is restored.

The only way you can get around this is to do what the taskbar does - periodically take a snapshot of the desired window, and when it is minimized, use a cached image instead. Of course, this means that your application should have previously monitored the target window (this obviously will not work if the first time you want to take a picture of the window while it is minimized).

+3
source share

This guy managed to do what you need: http://www.codeproject.com/Articles/20651/Capturing-Minimized-Window-A-Kid-s-Trick I know this question is really old, but it may be fair to someone.

+4
source share

All Articles