Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 209
  • Last Modified:

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

Hi,


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?

Thanks
Madhavi.
0
osi-sys
Asked:
osi-sys
1 Solution
 
AndyAinscowCommented:
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
0
 
osi-sysAuthor Commented:
Thanks AndyAinscow, it's working now
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

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