
Camera Disabled By Security Policy
Security policies in Windows Mobile 6.1 provide a mechanism for the administrator to remotely disable the camera on a device that is enrolled on the network. If a security policy disables the camera, the effect depends on whether the application controls the camera using the native API or the managed API:
- The native function, SHCameraCapture, returns the error code ERROR_RESOURCE_DISABLED.
- The ShowDialog method of the managed class, CameraCaptureDialog, returns DialogResult.Cancel, which is the same return value as if the user pressed the Cancel button.
To determine if the security policy is in effect before attempting to call one of the camera APIs, examine the CameraEnabled value under the following registry key:
HKEY_LOCAL_MACHINE\System\State\Hardware
| Value | Type | Description |
| CameraEnabled | REG_DWORD | Specifies whether the camera is enabled or disabled. If set to 0, the camera is disabled. All other values indicate the camera is enabled. |