I have been looking at the DXGI Desktop Duplication Sample on msdn, which looks very nice but it isn't clear that it will work for what I want to do.
What I would like to do is to use the Win32 Desktop api's to create a new desktop (CreateDesktop
) then switch to that desktop (SwitchDesktop
) and then in that new desktop I would like to create a window and render a live preview of the original desktop.
Despite the name the DXGI api's appear to be more related to "screens" not Desktops, in the Win32 sense. Before I invest a lot of time attempting to implement this only to find out that it doesn't work I was hoping someone more knowledgeable of these api's could chime in and steer me in the right direction.
Previous attempts to do this with other common screen capture methods have resulted in failure as the images are always black. I am hoping DXGI will allow me to render non-active desktops into a DirectX texture which I can then display in my app.
I think the answer to this is that you can't do it. I have since abandoned this approach and now believe that the RDP api's are what I actually need to accomplish this. I think that in DXGI when they say "Desktop" they actually mean "Screen".
I haven't been able to figure out how to do this with the RDP api's yet either but I believe it is possible.