CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Guest

    Remove "Untitled" from SDI menu bar

    How to remove the "Untitled" from a SDI menu bar. Please provide sample of code if you know. Thank you

    jana


  2. #2
    Join Date
    May 1999
    Location
    Republic of Korea
    Posts
    100

    Re: Remove "Untitled" from SDI menu bar

    Try to override precreatewindow() func like following

    BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
    {
    cs.style &= ~FWS_ADDTOTITLE;

    return CFrameWnd::PreCreateWindow(cs);
    }

    Hope for help.

    Walter



  3. #3
    Join Date
    Apr 1999
    Location
    Malaysia
    Posts
    224

    Re: Remove "Untitled" from SDI menu bar

    Easy; just add a line in the your App InitInstance() function.
    Example...

    BOOL CYourSDIApp::InitInstance()
    {
    ....
    ...
    ...
    m_pMainWnd->UpdateWindow(); //Deafault, add my VC++
    m_pMainWnd->SetWindowText(""); //Add this line to remove the SDI title
    ..
    ..
    }

    Hello World!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured