how to get screen size in Windows

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

[Webinar] Streamline your web hosting managementRegister Today

x
 
DexstarConnect With a Mentor Commented:
@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
 
amakalskiAuthor Commented:
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
All Courses

From novice to tech pro — start learning today.