我想让自己的程序的Caption象IE那样,前面是文档名后面是程序名,怎么做?

解决方案 »

  1.   

    SetWindowText()
    你爱怎么着就怎么着!
      

  2.   


    UpdateFrameTitleForDocument(strFileName);具体用法,去msdn查。
      

  3.   

    我知道可以用SetWindowText()但是那样每次都要手动去改,经常会看到标题闪烁,很不自然,而且没有改的时候就又变成原来的了。UpdateFrameTitleForDocument,我没找到又这么个函数啊?
      

  4.   

    sorry, 原来msdn没用公布这个函数。:)使用很简单,在CMainFrame里用它,参数就是你要加的字符串。帮助也好找,在
    C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\VC98\MFC\
    search一下UpdateFrameTitleForDocument。是这样的:
    void CFrameWnd::UpdateFrameTitleForDocument(LPCTSTR lpszDocName)
      

  5.   

    是加在OnCreate里面吗?怎么没有效果啊?
      

  6.   

    试试这样:
    m_FileName.Format("%s", FileNameOnly(pDoc->m_FilePathName));
    pDoc->SetTitle(m_FileName);
      

  7.   

    FWS_PREFIXTITLE   Shows the document name before the application name in a frame window title. For example, "Document - WordPad". You can specify the strings displayed in the Advanced Options dialog box in AppWizard. If you need to turn this option off, override the CWnd::PreCreateWindow member function.
      

  8.   

    我昨天回家做出来了,就是用的easyrock说的那个。还是要感谢lengnuan,我就是查他说的那个函数才找到的解决办法。