Platform SDK: DirectX

Setting the Focus Window

[Visual Basic]

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

[C++]

To set the focus window, you call the IDirectDraw7::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.