Solved

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

Posted on 2015-01-03
8
251 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
Comment Utility
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 51

Expert Comment

by:Joe Winograd, EE MVE
Comment Utility
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
Comment Utility
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
 
LVL 31

Expert Comment

by:Helen_Feddema
Comment Utility
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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

Author Comment

by:ForExpert
Comment Utility
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
Comment Utility
>> 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
Comment Utility
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
Comment Utility
I haven't received any working solution, but which I referred partly works.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
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…

772 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now