Solved

Default MFC Window Size

Posted on 1998-10-21
2
515 Views
Last Modified: 2013-11-20
I'm developing a version of Pente using MFC for a programming class and have created a representation of the board.  However, the board doesn't fall within the bounds of the default window created when I open the application.  I began the program using the AppWizard.  How do I change the default size of the application window?
0
Comment
Question by:Mephisto
  • 2
2 Comments
 
LVL 2

Accepted Solution

by:
jrmcg earned 50 total points
Comment Utility
If this is an SDI or MDI application you can use the

CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
    cs.x = iXNum     // x-coordinate of upper-left corner of main window
    cs.y = iYNum    // y-coordinate of upper-left corner of main window
    cs.cx = iWNum // width of window
    cs.cy = iHNum  // height of window

    return CMDIFrameWnd::PreCreateWindow(cs);  // this is added with the wizard
}

You can add the PreCreateWindow override through the class wizard by selecting the application's MainFrame class and selecting PreCreateWindow from the messages.

I am assuming this is not a dialog application, because you should be able to just size the dialog at design time to suit your needs.  If this is not what you need let me know.

J.R.
0
 
LVL 2

Expert Comment

by:jrmcg
Comment Utility
AND --
If your display is inside a document of an  MDI then just override the PreCreateWindow of the frame class of that document using the same method.

J.R.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now