Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. SW_SHOWMAXIMIZED NOT WORKING

SW_SHOWMAXIMIZED NOT WORKING

Scheduled Pinned Locked Moved C / C++ / MFC
helpcsharpc++visual-studio
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    ashwath1979
    wrote on last edited by
    #1

    Hi All, I have created a MFC application with CFormView as the base class in Visual Studio 2008.The problem i am facing is that inspite of me having the below code

    m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);

    m_pMainWnd->UpdateWindow(); when the aplication starts up it is not shown as maximized window. Please help me in this. Thanking in advance, Ashwath.

    C K N 3 Replies Last reply
    0
    • A ashwath1979

      Hi All, I have created a MFC application with CFormView as the base class in Visual Studio 2008.The problem i am facing is that inspite of me having the below code

      m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);

      m_pMainWnd->UpdateWindow(); when the aplication starts up it is not shown as maximized window. Please help me in this. Thanking in advance, Ashwath.

      C Offline
      C Offline
      cariolihome
      wrote on last edited by
      #2

      Where did You call this function ? Please, show your code ...

      1 Reply Last reply
      0
      • A ashwath1979

        Hi All, I have created a MFC application with CFormView as the base class in Visual Studio 2008.The problem i am facing is that inspite of me having the below code

        m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);

        m_pMainWnd->UpdateWindow(); when the aplication starts up it is not shown as maximized window. Please help me in this. Thanking in advance, Ashwath.

        K Offline
        K Offline
        krmed
        wrote on last edited by
        #3

        I've never tried maximizing a form view based application, and in fact I modify the code to prevent that since only the frame maximizes - the controls stay where originally placed and in their original size...it just looks bad in my opinion. Having said that, however, you may find your problem is caused by the view class. In a form view based app, the OnInitialUpdate in the view class contains the line

        ResizeParentToFit();

        This resizes the main frame to fit the form you created. As I say, I haven't done this, but perhaps if you comment out that line, you may succeed with your maximizing. Good luck.

        Karl - WK5M PP-ASEL-IA (N43CS) PGP Key: 0xDB02E193 PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193

        1 Reply Last reply
        0
        • A ashwath1979

          Hi All, I have created a MFC application with CFormView as the base class in Visual Studio 2008.The problem i am facing is that inspite of me having the below code

          m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);

          m_pMainWnd->UpdateWindow(); when the aplication starts up it is not shown as maximized window. Please help me in this. Thanking in advance, Ashwath.

          N Offline
          N Offline
          Nelek
          wrote on last edited by
          #4

          I also think that resizing the form view without any other adjustments can end with unexpected issues in your controls or looking not so "nice". Anyways, have you tried to add the SW_SHOWMAXIMIZED to the default modes? I mean:

          pMainFrame->ShowWindow(m\_nCmdShow | SW\_SHOWMAXIMIZED);
          pMainFrame->UpdateWindow();
          

          This is to be called in your CYourApp::OnInitInstance ()

          Regards. -------- M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpfull answers is nice, but saying thanks can be even nicer.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups