get screen size function

Started by
0 comments, last by vurentjie 15 years, 10 months ago
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.
Advertisement
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?

This topic is closed to new replies.

Advertisement