Well good news mouser.
The errors with capturing in D3D10/11 were a different problem, you should leave both D3D10/11 as DriverType.Hardware in the device creation, and instead fix a different problem as outlined in the code below. D3D9 needs to still have the DriverType.None for it to work in fullscreen.
The problem is actually within the PresentHook where SlimDX is giving us some grief over disposing of its reference to the SwapChain - which cannot be done while in Fullscreen window mode - therefore we just have to keep a reference to the same SwapChain.
The bad news (for me) was that I didn't bother testing the original code until after half a day of stuffing around with it LOL!!! I just assumed it was a problem with the device creation
... It's times like these I wish I followed in my fathers footsteps and became a carpenter or maybe an electrician
. Anyway I think SlimDX might have something to do with it - and I'm in the process of switching to SharpDX, but that is a ways off for the moment.
Here is a snippet that will get it working for you, enjoy!
DXHookD3D10.cs:
private SwapChain _swapChain;
private IntPtr _swapChainPointer;
/// <summary>
/// Our present hook that will grab a copy of the backbuffer when requested. Note: this supports multi-sampling (anti-aliasing)
/// </summary>
/// <param name="swapChainPtr"></param>
/// <param name="syncInterval"></param>
/// <param name="flags"></param>
/// <returns>The HRESULT of the original method</returns>
int PresentHook(IntPtr swapChainPtr, int syncInterval, SlimDX.DXGI.PresentFlags flags)
{
if (swapChainPtr != _swapChainPointer)
{
_swapChain = SlimDX.DXGI.SwapChain.FromPointer(swapChainPtr);
}
SwapChain swapChain = _swapChain;
//using (SlimDX.DXGI.SwapChain swapChain = SlimDX.DXGI.SwapChain.FromPointer(swapChainPtr))
{
DXHookD3D11.cs:
private SwapChain _swapChain;
private IntPtr _swapChainPointer;
/// <summary>
/// Our present hook that will grab a copy of the backbuffer when requested. Note: this supports multi-sampling (anti-aliasing)
/// </summary>
/// <param name="swapChainPtr"></param>
/// <param name="syncInterval"></param>
/// <param name="flags"></param>
/// <returns>The HRESULT of the original method</returns>
int PresentHook(IntPtr swapChainPtr, int syncInterval, SlimDX.DXGI.PresentFlags flags)
{
if (swapChainPtr != _swapChainPointer)
{
_swapChain = SlimDX.DXGI.SwapChain.FromPointer(swapChainPtr);
}
SwapChain swapChain = _swapChain;
//using (SlimDX.DXGI.SwapChain swapChain = SlimDX.DXGI.SwapChain.FromPointer(swapChainPtr))
{