Multiple full-screen windows with DirectX 9.0
c++, directx, winapi
Solution
According to the Direct3D 9 documentation (Working with Multiple Monitor Systems): "The practical implication is that a multiple monitor application can place several devices in full-screen mode, but only if all these devices are for different adapters, were created by the same Direct3D9 object, and all share the same focus window."
You'll notice that there are two window handles per device initialization; the presentation window, and the focus window. The focus window (passed in to IDirect3D9::CreateDevice) is used for handling events such as switching from foreground to background, or Alt+Tab. The presentation window is passed in to the D3DPRESENT_PARAMETERS structure and is used solely as a canvas for Direct3D.
You should mark one of the windows you create (probably the first one) as the focus window. Share the focus window across devices but keep the "canvas" (presentation) windows separate.
EDIT: This may help you as well.
create a focus window for both devices.
(optionally) create a device window for the first adapter.
create a device window for the second adapter.
create a direct3d9 context.
use this to create both devices.
create the first fullscreen device using the shared focus window and (optionally) the first device window.
create the second fullscreen device using the shared focus window and the second device window.
reset the first device.
the shared focus window is passed directly as a parameter to CreateDevice.
the device windows are passed in the presentation parameters structure.
Problem
This is a bit of an edge case but I am developing a game which uses multiple monitors. For reasons outside the scope of this question, I am using a 'multi-device method' rather than swap chains. My code is similar to the following sample: http://www.codesampler.com/dx9src/dx9src_1.htm#dx9_multiple_devices What I'm struggling with, and what I can find no documentation about, is whether it's possible to run both windows in true full-screen (i.e `d3dpp.Windowed = FALSE;`). Currently I'm getting an 'invalid params' HRESULT when calling `CreateDevice` the second time. It works fine if one of the windows is full-screen, but not both. I'm hoping there's a setting to make this work though... Cheers in advance