// TimeBoard.cpp
#include "stdafx.h"
#include "ThreadTestB.h"
#include "TimeBoard.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CTimeBoard
CTimeBoard::CTimeBoard()
{
}
CTimeBoard::~CTimeBoard()
{
}
BEGIN_MESSAGE_MAP(CTimeBoard, CStatic)
//{{AFX_MSG_MAP(CTimeBoard)
ON_WM_TIMER()
ON_WM_CREATE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
void CTimeBoard::OnTimer(UINT nIDEvent)
{
CTime time=CTime::GetCurrentTime();
CString s;
s.Format("it is %2d:%2d:%2d now.",time.GetHour(),time.GetMinute(),time.GetSecond());
SetWindowText(s);
CStatic::OnTimer(nIDEvent);
}
int CTimeBoard::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CStatic::OnCreate(lpCreateStruct) == -1)
return -1;
SetTimer(0,5000,NULL);
return 0;
}