This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

This code sample is named CalendarAndDTP. It demonstrates how to use the Calendar Controlsand the Date and Time Picker (DTP) Controls, the use of custom formats in the DTP control, and Calendar Control styles.

Feature Area

Relevant APIs


To run the code sample

  1. Navigate to the solution file (*.sln), and double-click it. By default, the solution file is copied to the following folder:

    C:\Program Files\Windows Mobile 6.5.3 DTK\Samples\PocketPC\CPP\win32\CalendarAndDTP

    Microsoft Visual Studio launches and loads the solution.

  2. Build the solution (Ctrl+Shift+B).

  3. Deploy the solution (F5).

Development Environments

SDK:Windows Mobile Professional SDK and Windows Mobile Standard SDK

Development Environment:Visual Studio 2005 or 2008.

ActiveSync:Version 4.5.


ExTAPIAsyncdemonstrates how to develop an application that is based on Extended TAPIasynchronous functionality.

The following code is needed to use the calendar and DTP controls.

Copy Code
icex.dwSize = sizeof(icex);

icex.dwICC = ICC_DATE_CLASSES;You can create the second screen with scrollbars, and then pan a full year.

The controls are physically laid out on dialog boxes to make them easier to position and interact with at design time. In the dialog editor, they are the grey boxes on the dialog boxes. To set specific styles for these controls, open the *.RC file as a text file, find the control you want, and add or delete the style. For example, in the *.RC file, there will be a line that looks like this:

Copy Code

Add a new style next to the "0x4", such as "0x4 | DTM_STYLE". It will be changed by the dialog compiler to the correct hex value, provided the <commctrl.h>file is included. It is included in the resource.hfile in this example.

See Also