• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 211
  • Last Modified:

Help needed in setting the dimensions of the window, when clicked on restore?


I am working with SDI application in MFC. When I click on the restore button on the system menu of the MainFrame window, the window dimensions should be set to 2/3 the width and height of the screen resolutions.

Can anyone please suggest, where and how to handle this event?

1 Solution
AndyAinscowFreelance programmer / ConsultantCommented:
The OnSize member function is as follows
OnSize( UINT nType, int cx, int cy );
If nType is SIZE_RESTORED then the window has been resized.

width and height of screen
int iWidth = GetSystemMetrics(SM_CXFULLSCREEN);
int iHeight = GetSystemMetrics(SM_CYFULLSCREEN);

Now you can use SetWindowPos or Move Window to to place the window where you want and with what size you want
osi-sysAuthor Commented:
Thanks AndyAinscow, it's working now
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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now