IDirectDraw4::TestCooperativeLevel

The IDirectDraw4::TestCooperativeLevel method reports the current cooperative-level status of the DirectDraw device for a windowed or full-screen application.

HRESULT TestCooperativeLevel(void); 
 

Parameters

None.

Return Values

If the method succeeds, the return value is DD_OK, indicating that the calling application can continue executing.

If the method fails, the return value may be one of the following error values (see remarks):

DDERR_INVALIDOBJECT
DDERR_EXCLUSIVEMODEALREADYSET
DDERR_NOEXCLUSIVEMODE
DDERR_WRONGMODE

Remarks

This method is particularly useful to applications that use the WM_ACTIVATEAPP and WM_DISPLAYCHANGE system messages as a notification to restore surfaces or re-create DirectDraw objects. The DD_OK return value always indicates that the application can continue execution, but the failure codes are interpreted differently depending on the cooperative-level that the application uses. For more information, see Testing Cooperative Levels.

QuickInfo

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in ddraw.h.
  Import Library: Use ddraw.lib.