我建了个SDI文档应用,计划做一个工具名字叫XXX工具。可是一运行,框架的最上端出现“无标题”XXX工具,请问“无标题”三个字怎么去掉阿
必须建一个文档应用吗,我不想建一个新文档阿,不想用SDI自身定义的那一套。

解决方案 »

  1.   

    AfxGetMainWnd()->SetWindowText("YOur Titile Name");
      

  2.   

    AfxGetMainWnd()->SetWindowText("YOur Titile Name");
      

  3.   

    BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
    {
    if( !CFrameWnd::PreCreateWindow(cs) )
    return FALSE;
    // TODO: Modify the Window class or styles here by modifying
    //  the CREATESTRUCT cs
        cs.style &= ~FWS_ADDTOTITLE;
    return TRUE;
    }
      

  4.   

    楼上都说完了,我补充下
    用 文档类的 SetTitle 也可以
      

  5.   

    用class wazid 在文档类加上SetTitle函数,在SetTitle里写你的标题void CFoobarDoc::SetTitle(LPCTSTR lpszTitle) 
    {
    // TODO: Add your specialized code here and/or call the base class

    CDocument::SetTitle("foobar");
    }