如题

解决方案 »

  1.   

    在view里:
     GetParentFrame()->SetWindowText("hello,it's my own title!");
      

  2.   

    in your BOOL CxxxApp::InitInstance()
    {
          m_pMainWnd->ShowWindow(SW_SHOW);
    m_pMainWnd->UpdateWindow();
             //this add
    m_pMainWnd->SetWindowText("hello world!");
    }
      

  3.   

    看一看资源中的string table
    和两个宏
    FWS_ADDTOTITLE
    FWS_PREFIXTITLE
      

  4.   

    http://www.codeguru.com/doc_view/no_untitled.shtml
    http://www.codeguru.com/doc_view/animate_icon.shtml
      

  5.   

    在mfc中如何去掉untitled---MyProject?
    ----------------------------
    如果只是但读取掉untitled可以通过简单地重载函数:
    CDocument::SetTitle()实现!
    void CMyDoc::SetTitle(LPCTSTR lpszTitle)
    {
    CDocument::SetTitle("MyTitle");
    }
    则主窗口的标题变为:MyTitle--MyProject
    当然可以在应用程序的任何地方调用函数:
    (AfxGetMainWnd())->SetWindowText("yourproject");
    来改变主标题MyProject
    如果只想让标题改为单独的一项:
    void CMainFrame::OnUpdateFrameTitle()
    {
    CString str;
    str.Format(AFX_IDS_APP_TITLE);
    SetWindowText(str);
    }
      

  6.   

    重载
    BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
    {
    if( !CFrameWnd::PreCreateWindow(cs) )
    return FALSE;
    cs.style = WS_OVERLAPPED | WS_CAPTION
    | WS_SYSMENU ;
    cs.lpszName="你想要的名字";
    return TRUE;
    }
      

  7.   

    BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
    {
    if( !CMDIFrameWnd::PreCreateWindow(cs) )
    return FALSE;
    cs.style = WS_OVERLAPPED | WS_CAPTION// | FWS_ADDTOTITLE
    | WS_THICKFRAME | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_MAXIMIZE; return TRUE;
      

  8.   

    (AfxGetMainWnd())->SetWindowText("New Title");
      

  9.   

    在 BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) 里加
    cs.style &= ~FWS_ADDTOTITLE;
    CMainFrame::SetTitle("Your Title");
      

  10.   

    BOOL CMyDoc::OnNewDocument()
    {
    if (!CDocument::OnNewDocument())
    return FALSE;CDocument::SetTitle("Myname"); ////////   
    return TRUE;}