I am now trying to create a screen capture program. Last week I have tried the GetFrontBufferData method and it succeed. However, its performance is terrible and can only catch the desktop images. It means that when I start to run a full screen game, the GetFrontBufferData Method will get nothing. But what I want is to catch the full screen game not the desktop images.
In the GetFrontBufferData solution, I created a device and let the HWND parameter be NULL. I wonder if I can get the handle of the toplevel window (mean, the handle of full screen game), and pass it to the CreateDevice method, I can catch its screen shot.
Actually I have tried several screen capture method based on DX9. I have studied the questions Fastest method of screen capturing and tried the GetRenderTarget() method in conjunction with GetRenderTargetData(). The problem is I can only get the Render data rendered by the program itself. And the same with GetBackBuffer().
So the problem comes to, can I get a specific window image (like some running full screen game) if I can get the Handle of the toplevel window? I have checked the EnumWindow method described in Win32 - Get Main Wnd Handle of application. This code seems to get windows which only created by the program it self according to my test. However I need to get some windows created by the other programs.
So, that is my question. In a word, I want to know two things: 1, Is my approach that get handles of other windows then pass it to the CreateDevice and get its screen shot right? 2, If it is right, how to get the handles; if it is wrong, what is the rigth way to capture the full screen games?