The easy one is the second one. You can simply use the MCM_GETMONTHRANGE
message – or, more simply, the MonthCal_GetMonthRange
'macro' – to obtain this information.
For example (uses CommCtrl
),
procedure TForm1.FormClick(Sender: TObject);
var
st: array[0..1] of TSystemTime;
begin
MonthCal_GetMonthRange(MonthCalendar1.Handle, GMR_VISIBLE, @st);
Caption := IntToStr(st[0].wMonth);
end;