Maximizing window with MFC

This is a discussion on Maximizing window with MFC within the Windows Programming forums, part of the Platform Specific Boards category; HI, this must be very simple, but I'm new to Windows programming. I want to maximize the main program's window ...

  1. #1
    Registered User
    Join Date
    Sep 2003
    Posts
    87

    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:
    cs.cx=GetDeviceCaps(::GetDC(this->m_hWnd),HORZRES);  and cs.cy=GetDeviceCaps(::GetDC(this->m_hWnd),VERTRES);
    in the
    Code:
    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
    Posts
    490

    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:

    Code:
    m_pMainWnd->ShowWindow(SW_SHOW);
    Just change SW_SHOW to SW_MAXIMIZE.
    Website(s): http://www16.brinkster.com/trifaze/

    E-mail: trifaze_mattu@lycos.com

    ---------------------------------
    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, 07: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, 10: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21