[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

how to get screen size in Windows

Posted on 2003-12-02
2
Medium Priority
?
6,333 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 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

834 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