Solved

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

Posted on 2015-01-03
8
299 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 54

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 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

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.
In this post we will learn different types of Android Layout and some basics of an Android App.
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…

751 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