Thread: Maximizing window with MFC

  1. #1
    Registered User
    Join Date
    Sep 2003

    Maximizing window with MFC

    HI, this must be very simple, but I'm new to Windows programming.

    I want to maximize the main program's window at startup. But if I change cx and cy member of the CREATESTRUCT structure to values:
    Code:>m_hWnd),HORZRES);  and>m_hWnd),VERTRES);
    in the
    BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
    function this window's size is the size of the whole screen and at the bottom is hiden from the taskbar of the windows. I it's y-size to smaller- not to overlap with the taskbar.

  2. #2
    Programming is fun, mkay?
    Join Date
    Oct 2001

    Post ShowWindow, maybe?

    You might want to try the ShowWindow function. Well, there is already a call to this function in your application's class (ex. MyApp.cpp) inside the "InitInstance()" function. It should be something like:

    Just change SW_SHOW to SW_MAXIMIZE.


    C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
    DirectX Version: 9.0b
    DX SDK: DirectX 8.1 SDK

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Just starting Windows Programming, School me!
    By Shamino in forum Windows Programming
    Replies: 17
    Last Post: 02-22-2008, 08:14 AM
  2. WM_CAPTION causing CreateWindowEx() to fail.
    By Necrofear in forum Windows Programming
    Replies: 8
    Last Post: 04-06-2007, 08:23 AM
  3. 6 measly errors
    By beene in forum Game Programming
    Replies: 11
    Last Post: 11-14-2006, 11:06 AM
  4. My Window Class
    By Epo in forum Game Programming
    Replies: 2
    Last Post: 07-10-2005, 02:33 PM
  5. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 12:34 PM