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

    Overriding the maximize button for the main window in a MDI application

    I am looking for a way to override the maximize button for the main window in an MDI application. I have found several articles telling me how to override the maximize button for the child window, but not the main window. What I need is when the User clicks on the maximize button the application maximizes itself to two monitors instead of just one monitor. I hope that somebody can help me.

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

    Re: Overriding the maximize button for the main window in a MDI application

    Victor Nijegorodov

  3. #3
    Join Date
    Feb 2005
    Posts
    2,160

    Re: Overriding the maximize button for the main window in a MDI application

    Quote Originally Posted by berger_the_great
    I am looking for a way to override the maximize button for the main window in an MDI application. I have found several articles telling me how to override the maximize button for the child window, but not the main window. What I need is when the User clicks on the maximize button the application maximizes itself to two monitors instead of just one monitor. I hope that somebody can help me.
    Are you talking about the frame window (CMainFrame)? Handle the WM_SYSCOMMAND message (OnSysCommand() in the main frame window) and intercept the SC_MAXIMIZE command.

  4. #4
    Join Date
    May 2008
    Posts
    3

    Re: Overriding the maximize button for the main window in a MDI application

    Quote Originally Posted by hoxsiew
    Are you talking about the frame window (CMainFrame)? Handle the WM_SYSCOMMAND message (OnSysCommand() in the main frame window) and intercept the SC_MAXIMIZE command.
    Thank you that was extremely helpful

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

    Re: Overriding the maximize button for the main window in a MDI application

    Perhaps handling the WM_GETMINMAXINFO message would help.

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