Reports the current cooperative-level status of the Direct3D device for a windowed or full-screen application.
- hWindow [in]
The destination window handle to check for occlusion. When this parameter is NULL, S_PRESENT_OCCLUDED is returned when another device has fullscreen ownership. When the window handle is not NULL, window's client area is checked for occlusion. A window is occluded if any part of it is obscured by another application.
Possible return values include: D3D_OK, D3DERR_DEVICELOST, D3DERR_DEVICEHUNG, D3DERR_DEVICEREMOVED, or D3DERR_OUTOFVIDEOMEMORY (see D3DERR), or S_PRESENT_MODE_CHANGED, or S_PRESENT_OCCLUDED (see S_PRESENT).
This method replaces IDirect3DDevice9::TestCooperativeLevel, which always returns S_OK in Direct3D 9Ex applications.
We recommend not to call CheckDeviceState every frame. Instead, call CheckDeviceState only if the IDirect3DDevice9Ex::PresentEx method returns a failure code.
See Lost Device Behavior Changes for more information about lost, hung, and removed devices.
Build date: 11/16/2013