IDirectDraw7::TestCooperativeLevel method (ddraw.h)

Reports the current cooperative-level status of the DirectDraw device for a windowed or full-screen application.

Syntax

HRESULT TestCooperativeLevel();

Return value

If the method succeeds, the return value is DD_OK, which indicates that the calling application can continue.

If it fails, the method can return 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 recreate DirectDraw objects. The DD_OK return value always indicates that the application can continue, but the error codes are interpreted differently, depending on the cooperative level that the application uses.

Requirements

Requirement Value
Target Platform Windows
Header ddraw.h
Library Ddraw.lib
DLL Ddraw.dll

See also

IDirectDraw7