Platform SDK: DirectX |
The DirectDraw7.TestCooperativeLevel method reports the current cooperative-level status of the DirectDraw device for a windowed or full-screen application.
object.TestCooperativeLevel() As Long
If the method succeeds, it returns DD_OK, indicating that the calling application can continue executing.
If the method fails or DD_OK is not returned, an error is raised, and Err.Number can be set to one of the following values (see Remarks):
DDERR_INVALIDOBJECT |
DDERR_EXCLUSIVEMODEALREADYSET |
DDERR_NOEXCLUSIVEMODE |
DD_OK |
DDERR_WRONGMODE |
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. A 0 return value always indicates that the application can continue without restoring or recreating surfaces, but the error codes are interpreted differently, depending on the cooperative level that the application uses. For more information, see Testing Cooperative Levels.