|
|
Modified source to manage two or more monitors
I modified the source code to manage two or more monitors, and added some bonus too:
- It shows current main display resolution - It shows current secondary displays resolution - It shows the list of displays found, with their resolution, depth and refresh rate - It sets the resolution of any display connected Help is available with setgetscreenres -? Here is the code:
Modified source to manage two or more monitors
THANKS A LOT!
I have found only an annoying C++ error:
$ c++ setgetscreenres.m -framework ApplicationServices -o setgetscreenres setgetscreenres.m: In function ‘ListDisplays’: setgetscreenres.m:104: error: ‘for’ loop initial declaration used outside C99 modeBut you can avoid it changing lines 101-104 by:
int h, v, depth, freq, i;
printf("Displays found: %dn", dispCount);
for (i = 0 ; i < dispCount ; i++ ) {
One more thing...
Ouch, that's true; I didn't get that error because I compiled it under XCode, which accepts that syntax.
...a small addition...
Changing my ListDisplays() function with the following, we can see which display is the primary (i.e. the one with the menu bar):
With this mod, the displays listing (using setgetscreenres -l) will look like this one:
stating that Display 2 is the main display. |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.05 seconds |
|