Share via


Device.CheckCooperativeLevel Method (Int32)

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

Namespace: Microsoft.WindowsMobile.DirectX.Direct3D
Assembly: Microsoft.WindowsMobile.DirectX (in microsoft.windowsmobile.directx.dll)

Syntax

'Declaration
Public Function CheckCooperativeLevel ( _
    <OutAttribute> ByRef hResult As Integer _
) As Boolean
'Usage
Dim instance As Device
Dim hResult As Integer
Dim returnValue As Boolean

returnValue = instance.CheckCooperativeLevel(hResult)
public bool CheckCooperativeLevel (
    out int hResult
)
public:
bool CheckCooperativeLevel (
    [OutAttribute] int% hResult
)
public boolean CheckCooperativeLevel (
    /** @attribute OutAttribute() */ /** @ref */ int hResult
)
JScript does not support passing value-type arguments by reference.

Parameters

  • hResult
    The current cooperative-level status of the device for a windowed or full-screen application, reported using a ResultCode value. A Success result indicates that the device is operational and that the calling application can continue. A DeviceLost result indicates that the device is lost but cannot be reset at this time; therefore, rendering is not possible. A DeviceNotReset result indicates that the device is lost but can be reset at this time.

Return Value

true if the device is operational and the calling application can continue; false if the device is lost or needs to be reset.

Remarks

If the device is lost but cannot be restored at the current time, CheckCooperativeLevel returns the DeviceLost result code in the hResult parameter. This is the case, for example, when a full-screen device loses focus. If an application detects a lost device, it should pause and periodically call CheckCooperativeLevel until it receives a return value of DeviceNotReset. The application can then attempt to reset the device by calling Reset and, if this succeeds, restore the necessary resources and resume normal operation. Note that Present throws a DeviceLostException if the device is lost or not reset.

A call to CheckCooperativeLevel fails if made on a different thread than the one used to create the device being reset.

.NET Framework Security

  • Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see .

Platforms

Windows CE, Windows Mobile for Pocket PC, Windows Mobile for Smartphone

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

Version Information

.NET Compact Framework

Supported in: 2.0

See Also

Reference

Device Class
Device Members
Microsoft.WindowsMobile.DirectX.Direct3D Namespace