我刚学vc不久,做一课题,要求在状态栏里动态显示系统时间,象有一个小钟是的,各位有明白的,帮帮忙好吗?

解决方案 »

  1.   

    在状态栏的最左边显示时间
    static UINT indicators[] =
    {
            ID_SEPARATOR,//我们增加的
    ID_SEPARATOR,           
    ID_INDICATOR_CAPS,
    ID_INDICATOR_NUM,
    ID_INDICATOR_SCRL,
    };int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
    {
          ..... m_wndStatusBar.SetPaneInfo(1,ID_SEPARTOR,SBPS_NORMAL,60);
    }//菜单的响应函数
    void CMainFrame::OnTest() 
    {
        CTime t;
    t = CTime::GetCurrentTime();
    CString str = t.Format("%H - %M  -%S");
    m_wndStatusBar.SetPaneText(0,str);}
    我试了
    可以
    不行请给我发短消息
      

  2.   

    http://www.ccw.com.cn/htm/produ/special/vc/jiqiao/01_9_12_9.asp
      

  3.   

    加一个成员变量 UINT m_timer;
    OnCreate中
    m_timer = SetTimer(1,1000,NULL);void CMainFrame::OnTimer(UINT nIDEvent) 
    {
        OnTest();
       CFrameWnd::OnTimer(nIDEvent);
    }CMainFrame::~CMainFrame()
    {
    KillTimer(m_timer);
    }