状态栏上加时间

void CMainFrame::SetStatusBarTime() { CString strTime = CTime::GetCurrentTime().Format("%Y:%m:%d %H:%M:%S"); CClientDC dc(this); CSize sz = dc.GetTextExtent(strTime); int nIndex = 0; nIndex = m_wndStatusBar.CommandToIndex(IDS_TIMER); m_wndStatusBar.SetPaneInfo(nIndex,IDS_TIMER,SBPS_NORMAL,sz.cx); m_wndStatusBar.SetPaneText(nIndex,strTime); }

你可能感兴趣的:(timer)