DirectX SDK

DirectDraw7.SetCooperativeLevel

The DirectDraw7.SetCooperativeLevel method determines the top-level behavior of the application.

object.SetCooperativeLevel( _ 
    hdl As Long, _ 
    flags As CONST_DDSCLFLAGS)

Parameters

object
Object expression that resolves to a DirectDraw7 object.
hdl
Window handle used for the application. Set to the calling application's top-level window handle (not a handle for any child windows created by the top-level window). This parameter can be 0 when the DDSCL_NORMAL flag is specified in the flags parameter.
flags
One or more of the constants from the CONST_DDSCLFLAGS enumeration.

Error Codes

If the method fails, it raises an error, and Err.Number can be set to one of the following values:

DDERR_EXCLUSIVEMODEALREADYSET
DDERR_HWNDALREADYSET
DDERR_HWNDSUBCLASSED
DDERR_INVALIDOBJECT
DDERR_INVALIDPARAMS
DDERR_OUTOFMEMORY

Remarks

This method must be called by the same thread that created the application window.

An application must set either the DDSCL_EXCLUSIVE or the DDSCL_NORMAL flag.

The DDSCL_EXCLUSIVE flag must be set to call functions that can have drastic performance consequences for other applications. For more information, see Cooperative Levels.

See Also

DirectDraw7.SetDisplayMode, DirectDraw7.GetDisplayModesEnum, Mode X and Mode 13 Display Modes, Focus and Device Windows.