Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This macro determines which portion of a month calendar control is at a specified point on the screen.

Syntax

DWORD MonthCal_HitTest(
  HWND 
hwndMC, 
  PMCHITTESTINFO 
pMCHitTest 
);

Parameters

hwndMC

Handle to a month calendar control.

pMCHitTest

Pointer to an MCHITTESTINFOstructure. Upon sending the macro, the cbSizemember must equal sizeof(MCHITTESTINFO), and ptmust be set to the point you want to hit test.

Return Value

Sets values in members of the MCHITTESTINFO structure at pMCHitTestand returns one of the following DWORDvalues:

MCHT_CALENDARBK

The specified point was in the calendar's background.

MCHT_CALENDARDATE

The specified point was on a particular date within the calendar. The SYSTEMTIME structure at lpMCHitTest->st is set to the date at the specified point.

MCHT_CALENDARDATENEXT

The specified point was over a date from the next month (partially displayed at the end of the currently displayed month). If the user clicks here, the month calendar will scroll its display to the next month or set of months.

MCHT_CALENDARDATEPREV

The specified point was over a date from the previous month (partially displayed at the end of the currently displayed month). If the user clicks here, the month calendar will scroll its display to the previous month or set of months.

MCHT_CALENDARDAY

The specified point was over a day abbreviation (Fri). The SYSTEMTIME structure at lpMCHitTest->st is set to the corresponding date in the top row.

MCHT_CALENDARWEEKNUM

The specified point was over a week number (the MCS_WEEKNUMBERS style only). The SYSTEMTIME structure at lpMCHitTest->st is set to the corresponding date in the leftmost column.

MCHT_NOWHERE

The specified point was either not on the month calendar control, or in an inactive portion of the control.

MCHT_TITLEBK

The specified point was over the background of a month's title.

MCHT_TITLEBTNNEXT

The specified point was over the button at the top right corner of the control. If the user clicks here, the month calendar will scroll its display to the next month or set of months.

MCHT_TITLEBTNPREV

The specified point was over the button at the top left corner of the control. If the user clicks here, the month calendar will scroll its display to the previous month or set of months.

MCHT_TITLEMONTH

The specified point was in a month's title bar, over a month name.

MCHT_TITLEYEAR

The specified point was in a month's title bar, over the year value.

The uHitmember of the MCHITTESTINFOstructure at pMCHitTestwill equal the return value.

Remarks

Related message:  MCM_HITTEST

Requirements

Header commctrl.h
Windows Embedded CE Windows CE 2.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

MCHITTESTINFO