Solved

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

Posted on 2015-01-03
8
266 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 37

Expert Comment

by:Gerwin Jansen
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 52

Expert Comment

by:Joe Winograd, EE MVE
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 85

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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
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 37

Expert Comment

by:Gerwin Jansen
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

A short article about a problem I had getting the GPS LocationListener working.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

776 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