CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 1999
    Location
    Bulgaria
    Posts
    236

    MDI without menus

    I am trying to make a full screen MDI but I am getting troubles when trying to get rid of the menus. A debug failure occurs when ::CreateEx is trying to execute. This happens in the InitInstance when trying to load the Main frame. I will be grateful if someone shows me the trick? I do not want to register new wndclass and I do not want to hide the menus.


  2. #2
    Join Date
    Apr 1999
    Posts
    3,585

    Re: MDI without menus

    If you're trying to remove the main menu, try this...

    //
    // Destroys normal menu associated with
    // mainframe application.
    //
    BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
    {

    if ( cs.hMenu != NULL )
    {
    :estroyMenu( cs.hMenu ); // Delete menu if loaded
    cs.hMenu = NULL; // No menu for main window
    }

    return CFrameWnd::PreCreateWindow(cs);
    }

    Gort...Klaatu, Barada Nikto!

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