Solved

how to get screen size in Windows

Posted on 2003-12-02
2
6,287 Views
Last Modified: 2007-12-19
Does anybody know how to get screen size in Windows using c++ or MFC code? By size I mean current screen resolution in pixels.
0
Comment
Question by:amakalski
2 Comments
 
LVL 19

Accepted Solution

by:
Dexstar earned 125 total points
ID: 9862727
@amakalski:

> Does anybody know how to get screen size in Windows using c++ or MFC code? By
> size I mean current screen resolution in pixels.

Use the API call "GetSystemMetrics".  The SM_CXFULLSCREEN and SM_CYFULLSCREEN parameters will give you the width and height (respectively).

Hope That Helps,
Dex*
0
 

Author Comment

by:amakalski
ID: 9863133
thanks Dex,
it helped, the only thing I changed is SM_CX FULLSCREEN to SM_CXSCREEN and SM_CYFULLSCREEN to SM_CYSCREEN because previous ones return screen size less taskbar area, but I needed whole screen area
0

Featured Post

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
C++ assignment question 7 199
mixing C++ & C# in Vis Studio 2013 7 176
Why isn't object file created? 6 59
Copy output image from TWindowsMediaPlayer 6 41
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
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.

777 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