Platform SDK: DirectX

DirectDraw Objects on Multiple Monitors

[Visual Basic]

The information in this topic pertains only to applications written in C++.

[C++]

Windowed DirectDraw applications written for the null or default display driver will work on MultiMon systems, but in applications optimized for MultiMon you will want to create a separate DirectDraw object for each device, using the GUID returned in the enumeration callback. (See Enumerating Devices on MultiMon Systems.)

There are some MultiMon behaviors that will vary depending on whether the application specfies a GUID or NULL during DirectDraw object creation. The most noteable one being that if the application specifies NULL, DirectDraw always clips the cursor to the primary monitor.

Avoid setting the cooperative level multiple times on a MultiMon system. If you need to switch from full-screen to normal mode, it is best to create a new DirectDraw object.

To make an application respond to a user pressing the ALT + TAB keys, the application should not use the default window procedure. To enable this functionality, the device window must change the focus to the parent window each time a SETFOCUS message is recieved.

It is good practice to release all DirectDraw objects at the same time. If you release only the secondary device or devices, the primary device goes back to its original desktop mode, but only the task bar is redrawn and the DirectDraw primary surface is still present. You cannot draw to this surface without first releasing the DirectDraw object and then re-creating it.