[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Default MFC Window Size

Posted on 1998-10-21
2
Medium Priority
?
554 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 2

Accepted Solution

by:
jrmcg earned 200 total points
ID: 1323683
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
ID: 1323684
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

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
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.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

649 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