Send Feedback

The SHCAMERACAPTURE structure contains information used to initialize the SHCameraCapture function. It also contains a reference to the fully-qualified path-name of the captured picture file or video file.

struct {
  DWORD cbSize;
  HWND hwndOwner;
  LPCTSTR pszInitialDir;
  LPCTSTR pszDefaultFileName;
  LPCTSTR pszTitle;
  DWORD nResolutionWidth;
  DWORD nResolutionHeight;
  DWORD nVideoTimeLimit;


  • cbSize
    The size of SHCAMERACAPTURE structure, in bytes.

  • hwndOwner
    A handle to the owner window. Can be NULL.

  • szFile
    The fully-qualified path-name of the captured picture file or video file (provided the SHCameraCapture function returns successfully).

  • pszInitialDir
    Specifies the directory for storing the captured picture or video file. If NULL, the image is stored in the directory defined in Pictures & Video > Camera Options > Type filename prefix:. If the directory does not exist, an E_INVALIDARG error is generated.

  • pszDefaultFileName
    Specifies the file name for the captured still image or video clip. Still images on Windows Mobile-based devices conform to the JPEG standard. As a result, file names for still images must end in *.jpg. There is no restriction for naming video files, other than the file format must be supported by Windows Media Player Mobile. Since different video encoders can use differing naming conventions, it is important that the file name has the correct extension. To be safe, you can simply use NULL when naming Video files. If pszDefaultFileName is NULL, then the file name specified in Pictures & Video > Camera Options > Save files to: is used. If the file already exists, it is overwritten. The combination of InitialDirectory and DefaultFileName must not exceed 256 characters.

  • pszTitle
    The title of the Camera Capture dialog box. If NULL, the default title of "Pictures & Videos" is used.

  • StillQuality
    One of the CAMERACAPTURE_STILLQUALITY enumeration values, which specifies the quality of the captured still image. The default is normal quality (CAMERACAPTURE_STILLQUALITY_NORMAL).

  • VideoTypes
    One of the CAMERACAPTURE_VIDEOTYPES enumeration values, which specifies a video quality profile (i.e., whether the video clip is to be used by an MMS application).

    Note   If nResolutionWidth and nResolutionHeight both equal 0, and VideoTypes equals CAMERACAPTURE_VIDEOTYPE_ALL, then the user's last selected resolution is used. For VideoTypes values of CAMERACAPTURE_VIDEOTYPE_STANDARD and CAMERACAPTURE_VIDEOTYPE_MESSAGING, either nResolutionWidth or nResolutionHeight must not equal 0.

  • nResolutionWidth
    The image width, in pixels. When nResolutionWidth equals 0 for video clips, then CAMERACAPTURE_VIDEOTYPES enumeration values are considered the only valid values for use in selecting video profiles.

  • nResolutionHeight
    The image height, in pixels. When nResolutionHeight equals 0 for video clips, then CAMERACAPTURE_VIDEOTYPES enumeration values are considered the only valid values for use in selecting video profiles.

  • nVideoTimeLimit
    The maximum length of time in seconds, allowed for a video clip. A time limit of 0 indicates that there is no limitation. The default is 0 (no limit).

  • Mode
    One of the CAMERACAPTURE_MODE enumeration values, which specifies the camera mode used to initialize the Camera Capture function.


Multimedia Messaging Service (MMS) applications must be able to capture video that meets criteria specific to multimedia messaging. This includes video format and file size. To accommodate this, it is up to the mobile device Original Equipment Manufacturer (OEM) to register Video Profiles for each of the Video Types (All, Standard, and Messaging). To be compliant, you just need to call SHCameraCapture with a Video Type and video resolution that matches one of the Video Profiles.

  • Video Type specifies whether the video should be recorded in a format that is compatible with video messaging (usually encoded in either MPEG4 format or H.263 format), or for use in home videos and e-mail messaging (usually encoded in Windows Media Video (WMV) format).
  • Video Profiles are registry settings that contain a combination of Video Type, video encoder, video resolution, and a profile name.

When you call the SHCameraCapture function, the Video Type and video resolution that you specify are matched to a corresponding Video Profile to determine which Video Profile is used to initialize video capture mode. Your CAMERACAPTURE_VIDEOTYPES value is logically ANDed (&) with the VideoType value in each registered profile (e.g., "VideoType:DWORD = 0x0002" for messaging). Of those that produce a 1, the video resolutions are then compared. If a matching Video Profile is found, then it is used to initialize video capture mode. If one cannot be found, then E_INVALIDARG is returned. In this case, you should just call SHCameraCapture again, this time with a CAMERACAPTURE_VIDEOTYPES value of CAMERACAPTURE_VIDEOTYPE_ALL (0xFFFF), and no specified video resolution; the first supported video resolution will then be used.

The following example demonstrates a typical video profile registration.

ItemString:String = "MMS (174x144)"
VideoType:DWORD = 0x0002 ; For messaging
Width:DWORD = 176
Height:DWORD = 144
...; Setting for the encoder

You can estimate the video file size that meets the time-limit restriction by specifying a particular video resolution.

Each Video Profile is listed as an option for the user in Pictures & Video > Menu > Quality.


Pocket PC: Windows Mobile 5.0 and later.
Smartphone: Windows Mobile 5.0 and later.
OS Versions: Windows CE 5.01 and later.
Header: Aygshell.h
Library: Aygshell.dll

See Also

SHCameraCapture Function | CAMERACAPTURE_MODE Enumeration | CAMERACAPTURE_STILLQUALITY Enumeration | CAMERACAPTURE_VIDEOTYPES Enumeration | Camera | Camera Capture Graph

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.