Solved

Figure out my app main screen size?

Posted on 1998-12-02
1
160 Views
Last Modified: 2013-11-20
How do you figure out the main screen size?  For example when my program
first starts i start it at 640x480 that way I can keep easily manipulate the
dialogs that is opened.  But if they increase the size of the main screen
horizontally or vertically then i need to figure out the main window screen
size.
It doesnt seem to be GetSystemMetrics().  Is there an api or mfc api that
lets you get your applications main window?

THanks

0
Comment
Question by:eric07
1 Comment
 

Accepted Solution

by:
McCreary earned 20 total points
ID: 1325654
RECT rect;
GetParent()->GetWindowRect(&rect);
If you are in the View, the GetParent() gets the CMainFrame window.
You might also want to use:
GetClientRect(&rect);

When the user resizes the window you get WM_SIZE message.  You can override the OnSize() virtual function if you need this notification.

0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Unix / Linux grid computing 5 157
ffmpeg - "rtsp://...... Operation not permitted" 4 80
isEverywhere  challenge 19 75
wordcount challenge 11 121
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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…
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.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

776 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