How to get screenshot of a window as bitmap object in C++? Supposed that I already have the window handle. And I want to know also whether it’s possible to get the screenshot of a window when it’s in minimized state?
C++ here means VC++ with all the libraries associated with Windows XP+ (win32).
you should call the PrintWindow API:
see this question: getting window screenshot windows API
if you are not using MFC, here the pure PrintWindow signature:
see MSDN for more details: http://msdn.microsoft.com/en-us/library/dd162869(v=vs.85).aspx
about how to save it as bitmap asMatteo said depends on the actual framework you are using…
EDIT:
here full example in raw C++