CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 11 of 11
  1. #1
    Join Date
    Mar 2009
    Posts
    29

    Maximize of Mainframe doesn't occupy whole screen

    Good day!

    I am trying to fix an issue in a program made by someone else, so i am not familiar with all of the code.
    Anyway, i hope it seems simple enough for someone experienced.

    The program is using MFC and is MDI.

    When the program starts it is in the maximized position by default.
    Sometimes the maximized position occupies correctly the whole screen (except from the taskbar)
    but sometimes it occupies less than the whole screen (about half an inch from the top is unoccupied)
    Note that if the program starts correctly occupying the screen it preserves this correct state through runtime.

    By using the getClientRect() of the main window i find that indeed the clientRect is less than it should when the whole screen isn't occupied.

    Anyone has encountered something similar? Any guesses?

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Maximize of Mainframe doesn't occupy whole screen

    Did you try to klick the "maximize" button on the mainframe system menu?
    Victor Nijegorodov

  3. #3
    Join Date
    Mar 2009
    Posts
    29

    Re: Maximize of Mainframe doesn't occupy whole screen

    Yes of course!

    I've done a lot of resizing/minimize/maximize both with buttons and with code i.e. ShowWindow(SW_MAXIMIZE) , but if the application started initially with wrong positioning, it keeps maximizing to this "false" position.

  4. #4
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: Maximize of Mainframe doesn't occupy whole screen

    Is there code overriding the default WM_SHOW or WM_GETMINMAXINFO handlers?

  5. #5
    Join Date
    Mar 2009
    Posts
    29

    Re: Maximize of Mainframe doesn't occupy whole screen

    No, nothing like that in the whole project...

  6. #6
    Join Date
    Mar 2003
    Location
    India {Mumbai};
    Posts
    3,871

    Re: Maximize of Mainframe doesn't occupy whole screen

    Look at the OnSize implementation. It must have some logic to resize the window.
    My latest article: Explicating the new C++ standard (C++0x)

    Do rate the posts you find useful.

  7. #7
    Join Date
    Mar 2009
    Posts
    29

    Re: Maximize of Mainframe doesn't occupy whole screen

    The OnSize implementation indeed contains something but i think it is irrelevant.

    void CMainFrame::OnSize(UINT nType, int cx, int cy)
    {
    CFrameWnd::OnSize(nType, cx, cy);
    }

    I commented the above line of code and still the positioning was wrong...

  8. #8
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Maximize of Mainframe doesn't occupy whole screen

    What you showed us is the default OnSize implementation, so it cannot be a reason of your trouble.
    How about a WM_SYSCOMMAND message handler?
    Victor Nijegorodov

  9. #9
    Join Date
    Mar 2009
    Posts
    29

    Re: Maximize of Mainframe doesn't occupy whole screen

    Nothing like that in the whole project as well...

  10. #10
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Maximize of Mainframe doesn't occupy whole screen

    Then I would suggest to consecutively remove all "non-important" things from this project, leaving only the "carcass" until the problem goes away.
    If it won't go away - post this "carcass"-project to the Forum.
    Victor Nijegorodov

  11. #11
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: Maximize of Mainframe doesn't occupy whole screen

    Quote Originally Posted by stakon View Post
    Nothing like that in the whole project as well...
    There's got to be. Can you post the header file for the mainframe class.

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