Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How can I make a screenshot when a window is minimized?

Posted on 2015-01-03
8
Medium Priority
?
413 Views
Last Modified: 2015-01-24
Hello,

Could somebody tell me how I can make a screenshot from a minimized window?
I've found a few solution, but these doesn't work properly:
http://www.codeproject.com/Articles/20651/Capturing-Minimized-Window-A-Kid-s-Trick
http://stackoverflow.com/questions/27024554/capture-screenshot-from-selected-minimized-window

Thank you in advance for your answer!
0
Comment
Question by:ForExpert
8 Comments
 
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 40530330
By definition, you can't do that as there is nothing on screen. Screens on a Windows desktop are only updated when they are (partly) visible. What is it you expect to get from a screen that is not visible? Is it a specific application that you want info from?
0
 
LVL 56

Expert Comment

by:Joe Winograd, EE MVE 2015&2016
ID: 40530340
I don't fully understand your requirement. Since you posted in the Topics of Miscellaneous Programming and Microsoft Development, I presume you want some code to do this. If so, in what language? Or do you want a stand-alone executable? In any case, are you OK with a solution that restores or maximizes the window, takes the screenshot, and then minimizes the window again? Also, what do you want to do with the screenshot? Leave it on the clipboard? Save it to an image file? If so, what file type — BMP, GIF, JPG, PNG, etc.? Regards, Joe
0
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 40532596
How do the links you posted "not work properly"?...without details on what you're doing and the results you're getting, we can't be of much help.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 31

Expert Comment

by:Helen Feddema
ID: 40535891
First you have to open the app, either restored or maximized, before you can capture a screen shot of it.  What programming language are you using?
0
 

Author Comment

by:ForExpert
ID: 40538887
Thank you for your answers!

I'd like to "track" a flash application in a browser in the background, because I'd like to work on the same computer too. So I start the browser and the application in a window and I make it minimized, because if a window always restored and minimized then the work will be impossible on the same computer.

I use Delphi, but the solution needs WinAPI, so if you could provid a C++ solution it would be almost the same. I can port it under Delphi.

I save and analyze the screenshot as a BMP file in the memory.

Please check the links, and you'll see their results. These solutions works when a windows in a background (so not in the front), but doesn't work when the window is minimized, Theoretically the codeproject solution works with minimzed windows also, but I tried it and it didn't work for me. The solution uses a PrintWindow WinAPI which uses WM_PRINT/WM_PRINTCLIENT messages to get the screenshot (and it restores the window as a transparent window and later make it back to minimized?).
0
 
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 40539027
>> but doesn't work when the window is minimized
I believe this is correct, the windows functionality of the Microsoft operating system is that once a window is on screen, the parts that are visible to the user must be 'drawn' or refreshed to show their contents. You can by some trick apparantly force a window to redraw its contents when it's behind another window and then use WM_PRINT to get that (hidden) content. But when the window is minimized (0px high 0px wide) then there just is nothing to draw or get a screenshot of. So if you can explain that part about "Theoretically the codeproject solution works with minimzed windows also" then I'd be interested :) Only way I can think of is how to do this is a virtual desktop (or a physical second display) that has the window you want captured being displayed (not minimized). There are several virtual desktops applications out the for Windows like VirtuaWin or Dexpot that you could try.
0
 

Accepted Solution

by:
ForExpert earned 0 total points
ID: 40557357
Codeproject solution works perfectly with normal windows under Windows. Please take a little time to test it. But I wanted to use this solution with flash applications also which run in a browser window. The problem was with this.
0
 

Author Closing Comment

by:ForExpert
ID: 40567971
I haven't received any working solution, but which I referred partly works.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question