May 30th, 2011, 04:50 PM
printscreen GetDC(NULL) Vista/7
I'm not entirely sure whether it's the good section to post this but here it is.
A while ago I made a simple app that takes screenshots at random intervals using the GDI. It's been working great under windows XP but unfortunately not at all under Vista and Seven. To be more accurate, it still works when I'm trying to capture the desktop or any window, even maximized but as soon as I toggle a full screen openGL application, I only get black screenshots.
Since it also happened when I tried to take a screenshot manually using the "Print Screen" key, I decided to do some research. Apparently, Vista and Seven now use a Desktop Window Manager which deals with the displaying by compositing the windows sent to it so we no longer have direct access to the frame being displayed.
Again, according to this link : http://www.opengl.org/pipeline/article/vol003_7/ , in full screen HW mode, there is no compositing, so when you try to access the content of the screen using GDI's GetDC(NULL) function, all you get is a black screen since there's nothing being drawn behind the 3D app !
Strangely enough, it works when I'm launching a full screen Direct3D application ! But unfortunately the article doesn't meantion anything about it..
So I don't really know what to do here.. Is there a way to force compositing even when an full screen OpenGL application is on ? Or is there any other way to get this GDI method to work ? If not, what are the other methods to capture screenshots for any type of applications (D3D and OpenGL) that work on XP/Vista and Seven ? Like, how does programs like FRAPS do it, do you know ?
June 5th, 2011, 09:34 AM
Re: printscreen GetDC(NULL) Vista/7
not entirely sure , you should look at hooking OpenGL API , to be precise , raster functions have a look at this link
Click Here to Expand Forum to Full Width