DiscoInferno
April 14th, 1999, 09:40 AM
I am attempting to modify the behaviour od the date time picker control so that when the user hits the drop down arrow of the calendar , the calendar is displayed without the Today date and the today circle. I have overode the DTN_DROPDOWN handler with the code shown below and I am attempting to change the style so that it excludes MTS_NOTODAY using GetWindowLong() and SetWindowLong() and the GWL_STYLE identifier. Is this the right identifier to use for common controls ? as the code seems to be having no effect.
ccode
LRESULT CImsPMQCtrl::OnDropdownDatetime_end(int idCtrl, LPNMHDR pnmh,
BOOL& bHandled)
{
HWND MCCtrlHWND;
MCCtrlHWND = (HWND)::SendMessage(m_hWNDEndDate, DTM_GETMONTHCAL, 0, 0);
long lStyle = ::GetWindowLong (MCCtrlHWND, GWL_STYLE);
lStyle &= ~MCS_NOTODAY;
lStyle &= ~MCS_NOTODAYCIRCLE;
::SetWindowLong (MCCtrlHWND, GWL_STYLE, lStyle);
return 0;
}
/ccode
ccode
LRESULT CImsPMQCtrl::OnDropdownDatetime_end(int idCtrl, LPNMHDR pnmh,
BOOL& bHandled)
{
HWND MCCtrlHWND;
MCCtrlHWND = (HWND)::SendMessage(m_hWNDEndDate, DTM_GETMONTHCAL, 0, 0);
long lStyle = ::GetWindowLong (MCCtrlHWND, GWL_STYLE);
lStyle &= ~MCS_NOTODAY;
lStyle &= ~MCS_NOTODAYCIRCLE;
::SetWindowLong (MCCtrlHWND, GWL_STYLE, lStyle);
return 0;
}
/ccode