Compartilhar via


CMonthCalCtrl::GetMonthRange

Retrieves date information representing the high and low limits of a month calendar control's display.

int GetMonthRange(
   COleDateTime& refMinRange,
   COleDateTime& refMaxRange,
   DWORD dwFlags 
) const;
int GetMonthRange(
   CTime& refMinRange,
   CTime& refMaxRange,
   DWORD dwFlags 
) const;
int GetMonthRange(
   LPSYSTEMTIME pMinRange,
   LPSYSTEMTIME pMaxRange,
   DWORD dwFlags 
) const;

Parameters

  • refMinRange
    A reference to a COleDateTime or CTime object containing the minimum date allowed.

  • refMaxRange
    A reference to a COleDateTime or CTime object containing the maximum date allowed.

  • pMinRange
    A pointer to a SYSTEMTIME structure containing the date at the lowest end of the range.

  • pMaxRange
    A pointer to a SYSTEMTIME structure containing the date at the highest end of the range.

  • dwFlags
    Value specifying the scope of the range limits to be retrieved. This value must be one of the following.

    Value

    Meaning

    GMR_DAYSTATE

    Include preceding and trailing months of visible range that are only partially displayed.

    GMR_VISIBLE

    Include only those months that are entirely displayed.

Return Value

An integer that represents the range, in months, spanned by the two limits indicated by refMinRange and refMaxRange in the first and second versions, or pMinRange and pMaxRange in the third version.

Remarks

This member function implements the behavior of the Win32 message MCM_GETMONTHRANGE, as described in the Windows SDK. In MFC's implementation of GetMonthRange, you can specify COleDateTime usage, a CTime usage, or a SYSTEMTIME structure usage.

Example

See the example for CMonthCalCtrl::SetDayState.

Requirements

Header: afxdtctl.h

See Also

Reference

CMonthCalCtrl Class

Hierarchy Chart

CMonthCalCtrl::GetRange

Other Resources

CMonthCalCtrl Members