I want to draw DirectX content so that it appears to be floating over top of the desktop and any other applications that are running. I also need to be able to make the directx content semi-transparent, so other things show through. Is there a way of doing this?
I am using Managed DX with C#.
I guess that will be hard without using the Desktop Window Manager, i.e. if you want to support Windows XP. With the DWM, it seems to be rather easy though.
If speed is not an issue, you may get away with rendering to a surface and then copying the rendered image to a layered window. Don't expect that to be fast though.
WPF is also another option.
You can either use DirectComposition, LayeredWindows, DesktopWindowManager or WPF. All methods come with their advantages and disadvantages:
-DirectComposition is the most efficient one, but needs Windows 8 and is limited to 60Hz.
-LayeredWindows are tricky to get working with D3D via Direct2D-interop using DXGI.
-WPF is relatively easy to use via D3DImage, but is also limited to 60Hz and DX9 and no MSAA. Interop to higher DX-Versions via DXGI are possible, also MSAA can be used when the MSAA-Rendertarget is resolved to the native nonMSAA surface.
-DesktopWindowManager is great for high performance available since Windows Vista, but DirectX-Versions seem to be limited by the Version the DWM uses (still DX9 on Vista). Workarounds for higher DX-Versions should be possible via DXGI where available
If you don't need per pixel aplha, you can also use the opacity-value of a semi-transparent form. I have been able to use all of the described techniques with C# and SharpDX, but in case of DirectComposition and LayeredWindows a little C++-Wrappercode was needed. For starters I would suggest to go via WPF.
I found a solution which works on Vista, starting from the link provided by OregonGhost. This is the basic process, in C# syntax. This code is in a class inheriting from Form. It doesn't seem to work if in a UserControl:
Lastly, a Form with default setting will have a glassy looking partially transparent background. Set the FormBorderStyle to "none" and it will be 100% transparent with only your content floating above everything.