?
Solved

how to get screen size in Windows

Posted on 2003-12-02
2
Medium Priority
?
6,319 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 19

Accepted Solution

by:
Dexstar earned 375 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

Question has a verified solution.

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

C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
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 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.
Suggested Courses

752 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