5,927
社区成员




var
m: Cardinal = 0;
b: Boolean = False; // 如果为true表示月份改变了,相当点击了左右选择月份的按钮
// OnGetMonthInfo 事件
procedure TForm1.monthCalendar1GetMonthInfo(Sender: TObject; Month: Cardinal;
var MonthBoldInfo: Cardinal);
begin
b := m <> Month;
end;
// returns FALSE if MCS_MULTISELECT
// returns TRUE and sets *pst to the currently selected date otherwise
{$EXTERNALSYM MonthCal_GetCurSel}
function MonthCal_GetCurSel(hmc: HWND; var pst: TSystemTime): BOOL;
// returns FALSE if MCS_MULTISELECT
// returns TURE and sets the currently selected date to *pst otherwise
{$EXTERNALSYM MonthCal_SetCurSel}
function MonthCal_SetCurSel(hmc: HWND; const pst: TSystemTime): BOOL;
// returns the maximum number of selectable days allowed
{$EXTERNALSYM MonthCal_GetMaxSelCount}
function MonthCal_GetMaxSelCount(hmc: HWND): DWORD;
// sets the max number days that can be selected iff MCS_MULTISELECT
{$EXTERNALSYM MonthCal_SetMaxSelCount}
function MonthCal_SetMaxSelCount(hmc: HWND; n: UINT): BOOL;
// sets rgst[0] to the first day of the selection range
// sets rgst[1] to the last day of the selection range
{$EXTERNALSYM MonthCal_GetSelRange}
function MonthCal_GetSelRange(hmc: HWND; rgst: PSystemTime): BOOL;
// selects the range of days from rgst[0] to rgst[1]
{$EXTERNALSYM MonthCal_SetSelRange}
function MonthCal_SetSelRange(hmc: HWND; rgst: PSystemTime): BOOL;
// if rgst specified, sets rgst[0] to the starting date and
// and rgst[1] to the ending date of the the selectable (non-grayed)
// days if GMR_VISIBLE or all the displayed days (including grayed)
// if GMR_DAYSTATE.
// returns the number of months spanned by the above range.
{$EXTERNALSYM MonthCal_GetMonthRange}
function MonthCal_GetMonthRange(hmc: HWND; gmr: DWORD; rgst: PSystemTime): DWORD;
// cbds is the count of DAYSTATE items in rgds and it must be equal
// to the value returned from MonthCal_GetMonthRange(hmc, GMR_DAYSTATE, NULL)
// This sets the DAYSTATE bits for each month (grayed and non-grayed
// days) displayed in the calendar. The first bit in a month's DAYSTATE
// corresponts to bolding day 1, the second bit affects day 2, etc.
{$EXTERNALSYM MonthCal_SetDayState}
function MonthCal_SetDayState(hmc: HWND; cbds: Integer; const rgds: TNMDayState): BOOL;
// sets prc the minimal size needed to display one month
{$EXTERNALSYM MonthCal_GetMinReqRect}
function MonthCal_GetMinReqRect(hmc: HWND; var prc: TRect): BOOL;
// set what day is "today" send NULL to revert back to real date
{$EXTERNALSYM MonthCal_SetToday}
function MonthCal_SetToday(hmc: HWND; const pst: TSystemTime): BOOL;
// get what day is "today"
// returns BOOL for success/failure
{$EXTERNALSYM MonthCal_GetToday}
function MonthCal_GetToday(hmc: HWND; var pst: TSystemTime): BOOL;
// determine what pinfo->pt is over
{$EXTERNALSYM MonthCal_HitTest}
function MonthCal_HitTest(hmc: HWND; var info: TMCHitTestInfo): DWORD;
// set colors to draw control with -- see MCSC_ bits below
{$EXTERNALSYM MonthCal_SetColor}
function MonthCal_SetColor(hmc: HWND; iColor: Integer; clr: TColorRef): TColorRef;
{$EXTERNALSYM MonthCal_GetColor}
function MonthCal_GetColor(hmc: HWND; iColor: Integer): TColorRef;
// set first day of week to iDay:
// 0 for Monday, 1 for Tuesday, ..., 6 for Sunday
// -1 for means use locale info
{$EXTERNALSYM MonthCal_SetFirstDayOfWeek}
function MonthCal_SetFirstDayOfWeek(hmc: HWND; iDay: Integer): Integer;
// DWORD result... low word has the day. high word is bool if this is app set
// or not (FALSE == using locale info)
{$EXTERNALSYM MonthCal_GetFirstDayOfWeek}
function MonthCal_GetFirstDayOfWeek(hmc: HWND): Integer;
// modifies rgst[0] to be the minimum ALLOWABLE systemtime (or 0 if no minimum)
// modifies rgst[1] to be the maximum ALLOWABLE systemtime (or 0 if no maximum)
// returns GDTR_MIN|GDTR_MAX if there is a minimum|maximum limit
{$EXTERNALSYM MonthCal_GetRange}
function MonthCal_GetRange(hmc: HWND; rgst: PSystemTime): DWORD;
// if GDTR_MIN, sets the minimum ALLOWABLE systemtime to rgst[0], otherwise removes minimum
// if GDTR_MAX, sets the maximum ALLOWABLE systemtime to rgst[1], otherwise removes maximum
// returns TRUE on success, FALSE on error (such as invalid parameters)
{$EXTERNALSYM Monthcal_SetRange}
function Monthcal_SetRange(hmc: HWND; gdtr: DWORD; rgst: PSystemTime): BOOL;
// returns the number of months one click on a next/prev button moves by
{$EXTERNALSYM MonthCal_GetMonthDelta}
function MonthCal_GetMonthDelta(hmc: HWND): Integer;
// sets the month delta to n. n = 0 reverts to moving by a page of months
// returns the previous value of n.
{$EXTERNALSYM MonthCal_SetMonthDelta}
function MonthCal_SetMonthDelta(hmc: HWND; n: Integer): Integer;
// sets *psz to the maximum width/height of the "Today" string displayed
// at the bottom of the calendar (as long as MCS_NOTODAY is not specified)
{$EXTERNALSYM MonthCal_GetMaxTodayWidth}
function MonthCal_GetMaxTodayWidth(hmc: HWND): DWORD;
{$EXTERNALSYM MonthCal_SetUnicodeFormat}
function MonthCal_SetUnicodeFormat(hwnd: HWND; fUnicode: BOOL): BOOL;
{$EXTERNALSYM MonthCal_GetUnicodeFormat}
function MonthCal_GetUnicodeFormat(hwnd: HWND): BOOL;