在CMainFrame构造函数中添加
CMainFrame::CMainFrame()
{
// TODO: add member initialization code here
SetTimer(1,1000);
}添加WM_TIMER消息处理函数
void CMainFrame::OnTimer(UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call default
CClientDC dc(this);
CString sTime;
SYSTEMTIME systime;
GetSystemTime(&systime);
sTime.Format("%u:%u:%u",systime.wHour, systime.wMinute, systime.wSecond);
CFrameWnd::OnTimer(nIDEvent);
}
CMainFrame::CMainFrame()
{
// TODO: add member initialization code here
SetTimer(1,1000);
}添加WM_TIMER消息处理函数
void CMainFrame::OnTimer(UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call default
CClientDC dc(this);
CString sTime;
SYSTEMTIME systime;
GetSystemTime(&systime);
sTime.Format("%u:%u:%u",systime.wHour, systime.wMinute, systime.wSecond);
CFrameWnd::OnTimer(nIDEvent);
}
在CMainFrame构造函数中添加
CMainFrame::CMainFrame()
{
// TODO: add member initialization code here
SetTimer(1,1000);
}添加WM_TIMER消息处理函数
void CMainFrame::OnTimer(UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call default
CClientDC dc(this);
CString sTime;
SYSTEMTIME systime;
GetSystemTime(&systime);
sTime.Format("%u:%u:%u",systime.wHour, systime.wMinute, systime.wSecond);
dc.TextOut(10,10,sTime);
CFrameWnd::OnTimer(nIDEvent);
}
SetTimer(1,1000,NULL);