CDateTime

Win32++

CDateTime Class

Description

The CDateTime class adds support for the date and time picker control. A date and time picker (DTP) control provides a simple and intuitive interface through which to exchange date and time information with a user.

Refer to the documentation that ships with the Microsoft Windows Software Development Kit for more information on the use of date and time picker controls. 

CDateTime Members

Construction
CDateTime
CDateTime();
Constructs the date and time picker control.   Attributes   GetMonthCalColor
COLORREF GetMonthCalColor(int iColor) const;
Gets the color for a given portion of the month calendar within a date and time picker (DTP) control. GetMonthCalCtrl
HWND GetMonthCalCtrl() const;
Gets the handle to a date and time picker's (DTP) child month calendar control. GetMonthCalFont
CFont* GetMonthCalFont() const;
Gets the font that the date and time picker (DTP) control's child month calendar control is currently using. GetRange
DWORD GetRange(LPSYSTEMTIME lpSysTimeArray) const;
Gets the current minimum and maximum allowable system times for the date and time picker (DTP) control. GetTime
DWORD GetTime(LPSYSTEMTIME pTimeDest) const;
Gets the currently selected time from a date and time picker (DTP) control and places it in a specified SYSTEMTIME structure. SetMonthCalColor
COLORREF SetMonthCalColor(int iColor, COLORREF ref);
Sets the color for a given portion of the month calendar within a date and time picker (DTP) control. SetFormat
BOOL SetFormat(LPCTSTR pstrFormat);
Sets the display of a date and time picker (DTP) control based on a given format string. SetMonthCalFont
void SetMonthCalFont(HFONT hFont, BOOL bRedraw = TRUE);
Sets the font to be used by the date and time picker (DTP) control's child month calendar control. SetRange
BOOL SetRange(DWORD flags, LPSYSTEMTIME lpSysTimeArray);
Sets the minimum and maximum allowable system times for the date and time picker (DTP) control. SetTime
BOOL SetTime(DWORD flag, LPSYSTEMTIME pTimeNew = NULL);
Sets the date and time picker (DTP) control to a given date and time.   Overridables PreRegisterClass
virtual void PreRegisterClass(WNDCLASS &wc);
Sets a date and time picker (DTP) control to a given date and time.
Base class Members

For base class members, refer to the members of CWnd.

Remarks

Date and time picker (DTP) controls have several Date and Time Picker Control Styles that determine a control's appearance and behavior. Specify the style when creating the control with the dwStyle parameter of CreateWindowEx. To retrieve or change the window style after you have created the control, use GetWindowLongPtr and SetWindowLongPtr.

Summary Information

Header file controls.h
Win32/64 support Yes
WinCE support Yes
Library required Comctl32.lib