Determining screen resolution in c++

Hey, thanks for taking the to read this!

I've got a question, how do you get the screen height and width in c++? The gdk library has the functions gdk_screen_get_width() and gdk_screen_get_height() which do what I need, but is there a cross-platform(one that will work in both windows/mac) way to do this?
Last edited on
There's no way to do it with just the standard libs because the standard libs don't even assume there's a screen at all.

If you want a cross-platform solution you'll have to look to 3rd party libs. Which lib you'd use could depend on what kind of program this is. What are you making?

A Windows specific approach is to use GetSystemMetrics -- although I forget the exact name of the metric you get. CX_SCREENX or something like that.
Topic archived. No new replies allowed.