Sign in to follow this  

get screen size function

This topic is 3462 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi, i want to write a small function that will detect the user's screen size, i have done a bit of research on the topic for windows it is a pretty simple call to GetSystemMetrics, i looked at Xlib calls, and these seem not to difficult either,something like
Display *display_name;

display_name = XOpenDisplay(NULL);

             DisplayWidth(display_name,screen),
             DisplayHeight(display_name,screen));
i am trying to find out more about the mac system, if anybody has information on this, it would be appreciated. I will continue googling, but thought I would drop a post here, hopefully somebody could provide me some advice. I don't own a mac myself, but can test on a friends. I think I should be looking at the Carbon API, but is this all? this last question sounds a bit duh?!? anyway advice appreciated.

Share this post


Link to post
Share on other sites
ok i did a bit of research on web, and i think what should be done is this....


Rect outAvailableRect;

GetAvailableWindowPositioningBounds ( GetMainDevice(), &outAvailableRect);

screenwidth = outAvailableRect.right - outAvailableRect.left;
screenheight = outAvailableRect.bottom - outAvailableRect.top;


is this more or less correct way to go about it?

Share this post


Link to post
Share on other sites

This topic is 3462 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this