在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);
}
解决方案 »
- 如何想文件夹里写入文件?
- 如何把WM_MOUSEMOVE的lParam参数转为一个POINT或POINTS类型?
- 禁用光驱、U盘、网卡
- 连接Sun的solaris系统FtpFindFirstFile获取的文件名不对,是什么原因??各位大侠帮帮忙吧,小弟急!
- 关于codeproject上一个序列化问题,看不懂!
- 我把收到的数据放在char *buf里面,可是遇到问题了。
- 怎样在驱动程序层中取时间?
- 在DIALOG中如何区分消息WM_LBUTTONDOWN和ON_WM_LBUTTONDBLCLK
- 想通过一个后台程序监视一个软件从而不让该软件运行,如何做?
- 菜鸟问题,如何将CString转换成char *
- 做一个像任务栏一样自动隐藏的窗口
- 高分求磁卡刷卡器和写卡器编程接口资料!
在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);