Jump to content

Capturing a window that isn't on top


Recommended Posts

Anybody have any pointers on what sort of functions might be able to do this? Basically I want to be able to get a screen shot of a window that is not the window on top. _ScreenCapture_CaptureWnd will only capture the region that the window is in.. if there is another window on top then it won't work.

Windows 7 seems to have a lot of this build in with their new menu bar. If I could use the same functions they do that would be ideal.. I've looked through all of the _WinAPI functions but I don't seem to see anything that would work. If there was some sort of way to hook into the active feed for what the window is displaying that would be amazing.

Alternatively if someone knows of an easy and light way to hook events like any windows losing focus that would work too.. 'cause then I could just grab a screen shot real quick before it gets covered up. (Preferably something more elegant than a while loop waiting for the top window to change.)

Edited by Achilles
My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

You should try WM_PRINT. You will need to create a DC... My guess would be to get the window DC and then create a compatible bitmap DC and draw on that (not that I know exactly what you should be doing, not my speciality).

Edit: Link: http://msdn.microsoft.com/en-us/library/dd145216(v=vs.85).aspx

You will want: PRF_NONCLIENT | PRF_CHILDREN

Edited by Mat
Link to comment
Share on other sites

Look at Windows Screenshooter where you can select the GUI handle and it will take a screenshoot of it.

Br,

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...