MonthCal_SetRange macro (commctrl.h)

Sets the minimum and maximum allowable dates for a month calendar control. You can use this macro or send the MCM_SETRANGE message explicitly.

Syntax

BOOL MonthCal_SetRange(
   HWND         hmc,
   DWORD        gd,
   LPSYSTEMTIME rgst
);

Parameters

hmc

Type: HWND

Handle to a month calendar control.

gd

Type: DWORD

Flag values that specify which date limits are being set. This value must be one or both of the following:

Value Meaning
GDTR_MAX
The maximum allowable date is being set. The SYSTEMTIME structure at rgst[1] must contain date information.
GDTR_MIN
The minimum allowable date is being set. The SYSTEMTIME structure at rgst[0] must contain date information.

rgst

Type: LPSYSTEMTIME

Pointer to a two-element array of SYSTEMTIME structures that contain the date limits. The maximum limit must be in rgst[1] if GDTR_MAX is specified, and rgst[0] must contain the minimum limit if GDTR_MIN is specified.

Return value

Type: BOOL

Returns nonzero if successful, or zero otherwise.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header commctrl.h