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

    How to maximize window ?

    Hello there!
    I need to maximize the main window of SDI program. I used PreCreateWindow function:

    BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
    {
    cs.style|=WS_MAXIMIZE;
    return CFrameWnd::PreCreateWindow(cs);
    }



    but nothing happend. What's wrong ?


  2. #2
    Guest

    Re: How to maximize window ?

    One way to do it is by using your InitInstance() function of your application class, as follows:

    BOOL CMyAp::InitInstance()
    {
    ...
    // Maximize the window. m_nCmdShow and m_pMainWnd are provided for
    // you by MFC. Just put these lines at the bottom of InitInstance().
    m_nCmdShow = SW_MAXIMIZE;
    m_pMainWnd->ShowWindow(m_nCmdShow);
    m_pMainWnd->UpdateWindow();

    return TRUE;



    I hope this helps,

    John G.




  3. #3
    Join Date
    May 2009
    Location
    Bengaluru, India
    Posts
    460

    Re: How to maximize window ?

    Thanks a lot this one is working

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