Setting the Focus Window

To set the focus window, you call the IDirectDraw4::SetCooperativeLevel method for each of the DirectDraw objects. You pass in a window handle (normally the application window handle) and set the DDSCL_SETFOCUSWINDOW flag, as in the following example:

/* It is presumed that lpDD is a valid IDirectDraw interface pointer,
   and that hWnd is a valid window handle. */
 
HRESULT ddrval = lpDD->SetCooperativeLevel( hWnd, 
        DDSCL_SETFOCUSWINDOW );
 

The focus window must be the same for all devices.