求帮忙看一下这段代码是什么意思void CEx_FileSimilarityDlg::OnTimer(UINT nIDEvent) {\x09// TODO: Add your message handler code here and/or call default\x09int m_nDayOfWeek;\x09CString str;\x09m_Time = CTime::GetCurrentTime();\x09m_strT

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/02 06:43:10
求帮忙看一下这段代码是什么意思void CEx_FileSimilarityDlg::OnTimer(UINT nIDEvent) {\x09// TODO: Add your message handler code here and/or call default\x09int m_nDayOfWeek;\x09CString str;\x09m_Time   = CTime::GetCurrentTime();\x09m_strT

求帮忙看一下这段代码是什么意思void CEx_FileSimilarityDlg::OnTimer(UINT nIDEvent) {\x09// TODO: Add your message handler code here and/or call default\x09int m_nDayOfWeek;\x09CString str;\x09m_Time = CTime::GetCurrentTime();\x09m_strT
求帮忙看一下这段代码是什么意思
void CEx_FileSimilarityDlg::OnTimer(UINT nIDEvent)
{
\x09// TODO: Add your message handler code here and/or call default
\x09int m_nDayOfWeek;
\x09CString str;
\x09m_Time = CTime::GetCurrentTime();
\x09m_strTime = m_Time.Format("\r\n%Y-%m-%d\r\n%H:%M:%S\r\n");
m_nDayOfWeek = m_Time.GetDayOfWeek();
str.Format(" 星期%d",m_nDayOfWeek-1);
m_strTime = m_strTime + str;
\x09
\x09if(nIDEvent == 1)
\x09{
\x09\x09GetDlgItem(IDC_EDIT3)->SetWindowText(m_strTime);
\x09}
\x09CDialog::OnTimer(nIDEvent);
}

求帮忙看一下这段代码是什么意思void CEx_FileSimilarityDlg::OnTimer(UINT nIDEvent) {\x09// TODO: Add your message handler code here and/or call default\x09int m_nDayOfWeek;\x09CString str;\x09m_Time = CTime::GetCurrentTime();\x09m_strT
这相当于一个定时器 就是将时间的变化作为窗体的text.
先是 获取当前的系统时间getcurrentTime() 将时间进行格式化处理,然后是获取是星期几
最后拼成字符串 作为window的text.
一旦定义了每隔多长时间来触发这个定时器,就会看到窗体的内容在不断的变化,就像钟表一样.