Figure 2. Contact Picker UI
Picture picker & camera capture dialogs
With the improvements to the imaging capability of Windows Mobile devices, the operating system now provides two of its built-in user interfaces for use by application developers. These are the dialogs for selecting a picture from a collection on the device and for directly working with the integrated camera if the device is equipped with one.
To activate the Picture Picker use the GetOpenFileNameEx API. The following sample uses the OFN_EXFLAG_THUMBNAILVIEW to show reduced-sized pictures on the window.
OPENFILENAMEEX ofnex = {0};
ofnex.lStructSize = sizeof(ofnex);
ofnex.ExFlags = OFN_EXFLAG_THUMBNAILVIEW;
ofnex.lpstrFile = new TCHAR [MAX_PATH];
ofnex.nMaxFile = MAX_PATH;
GetOpenFileNameEx(&ofnex);
The Camera Capture dialog is activated using the SHCameraCapture API as follows.
typedef struct {
DWORD cbSize;
HWND hwndOwner;
TCHAR szFile[MAX_PATH];
LPCTSTR pszInitialDir;
LPCTSTR pszDefaultFileName;
LPCTSTR pszTitle;
CAMERACAPTURE_STILLQUALITY StillQuality;
CAMERACAPTURE_VIDEOTYPES VideoTypes;
DWORD nResolutionWidth;
DWORD nResolutionHeight;
DWORD nVideoTimeLimit;
CAMERACAPTURE_MODE Mode;
} SHCAMERACAPTURE;
HRESULT SHCameraCapture (PSHCAMERACAPTURE *pshcc);
These two API's provide a simple and effective way of integrating camera functionality into your applications.
Figure 3. Picture Picker and Camera UI's
Windows Media Player 10
Windows Mobile 5.0 devices will have Windows Media Player 10 Mobile built-in. This powerful new media player provides enhanced security through DRM support and integration with the State and Notification Broker subsystem exposing information such as current track name, time remaining and artist. Within your application you can utilise the Windows Media Player 10 Mobile ActiveX control to playback media streams from your application. For full information on how to incorporate media player functionality into your applications, please see the Windows Media Player 10 SDK documentation.