CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 1999
    Posts
    388

    How to change the title of SDI project

    Please tell me how can we change the title of an SDI project which is by default 'untitled..'


  2. #2
    Join Date
    Apr 1999
    Posts
    306

    Re: How to change the title of SDI project

    Just redefine the PreCreateWindow function of the CMainFrame class like this:

    BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
    {
    // TODO: Modify the Window class or styles here by modifying
    // the CREATESTRUCT cs

    cs.style = WS_OVERLAPPEDWINDOW;
    cs.lpszName = "My ****ing Title";

    return CFrameWnd::PreCreateWindow(cs);
    }



  3. #3

    Re: How to change the title of SDI project

    If all you want to do is get rid of that ugly "Untitled - " part, and leave the name of your app behind, do this:

    // Comment out FWS_ADDTOTITLE to get rid of "Untitled - MyApp" on the title bar.
    BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
    {
    cs.style &= ~ FWS_ADDTOTITLE;
    return CFrameWnd::PreCreateWindow(cs);
    }


    LA Leonard - Definitive Solutions, Inc.

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