Solved

how to get screen size in Windows

Posted on 2003-12-02
2
6,275 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
Comment Utility
@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
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

728 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now