Dialog Box Size

Posted on 1998-11-24
Medium Priority
Last Modified: 2010-04-01
How do I choose / control the size of a dialog box when I run the code which opens it ?

Question by:decornez
  • 2

Accepted Solution

AlFa earned 30 total points
ID: 1178557
You can do this in the WM_INITDIALOG message response with a call to
BOOL MoveWindow(  HWND hWnd, // handle to window
  int X,          // horizontal position  
  int Y,          // vertical position
  int nWidth,     // width  
  int nHeight,    // height
  BOOL bRepaint   // repaint flag);


Author Comment

ID: 1178558

It is the correct function, but all I had to do was :

MoveWindow(50,50,300,500); //for example

no BOOL, no HWND needed.

Not sure why. Anyway, it does not matter as long as it works.


Expert Comment

ID: 1178559
You are in the C++ topic, so i was not extected to give a response using MFC

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

619 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