checked it.
Here is the code:
CheckDateTimeCtrl.h
#pragma once
// CCheckDateTimeCtrl
#define WM_DTN_CHECKCHANGED WM_APP + 100
class CCheckDateTimeCtrl : public CDateTimeCtrl
{
DECLARE_DYNAMIC(CCheckDateTimeCtrl)
public:
CCheckDateTimeCtrl();
virtual ~CCheckDateTimeCtrl();
protected:
afx_msg BOOL OnDtnDatetimechange(NMHDR *pNMHDR, LRESULT *pResult);
DECLARE_MESSAGE_MAP()
private:
BOOL m_Checked;
};
CheckDateTimeCtrl.cpp
// CheckDateTimeCtrl.cpp : implementation file
//
#include "stdafx.h"
#include "CheckDateTimeCtrl.h"
// CCheckDateTimeCtrl
IMPLEMENT_DYNAMIC(CCheckDateTimeCtrl, CDateTimeCtrl)
CCheckDateTimeCtrl::CCheckDateTimeCtrl()
: m_Checked(TRUE)
{
}
CCheckDateTimeCtrl::~CCheckDateTimeCtrl()
{
}
BEGIN_MESSAGE_MAP(CCheckDateTimeCtrl, CDateTimeCtrl)
ON_NOTIFY_REFLECT_EX(DTN_DATETIMECHANGE, OnDtnDatetimechange)
END_MESSAGE_MAP()
// CCheckDateTimeCtrl message handlers
BOOL CCheckDateTimeCtrl::OnDtnDatetimechange(NMHDR *pNMHDR, LRESULT
*pResult)
{
LPNMDATETIMECHANGE pDTChange =
reinterpret_cast<LPNMDATETIMECHANGE>(pNMHDR);
// TODO: Add your control notification handler code here
*pResult = 0;
if (!m_Checked && pDTChange->dwFlags == GDT_VALID)
{
MessageBox("Checked");
if (GetParent())
{
GetParent()->SendMessage(WM_DTN_CHECKCHANGED,1);
}
m_Checked = TRUE;
}
else if (m_Checked && pDTChange->dwFlags == GDT_NONE)
{
MessageBox("Unchecked");
if (GetParent())
{
GetParent()->SendMessage(WM_DTN_CHECKCHANGED,0);
}
m_Checked = FALSE;
}
return FALSE;
}
AliR.
"rsobies" <rsobies@discussions.microsoft.com> wrote in message
news:DD89522D-A097-4704-AB20-4D3B047D9BA4@microsoft.com...
this message is also send when a user change a date or when a user