Created
May 18, 2016 06:09
-
-
Save sephamorr/259e316c33f4adda3eae0ec486379d5c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <AppKit/NSScreen.h> | |
#import <AppKit/AppKit.h> | |
#import <Foundation/NSString.h> | |
#import <Foundation/NSNotification.h> | |
#import <CoreGraphics/CoreGraphics.h> | |
// #include <stdio.h> | |
#include <pthread.h> | |
#include <unistd.h> | |
int main() | |
{ | |
for(int i=0;i<20;i++) | |
{ | |
sleep(1); | |
NSArray *screens = [NSScreen screens]; | |
NSLog(@"Screens=%lu",[screens count]); | |
for (NSScreen *screen in screens) { | |
NSLog(@"%@", [[screen deviceDescription] objectForKey:@"NSScreenNumber"]); | |
NSPoint origin = [screen frame].origin; | |
NSLog(@"(%d,%d):%x", (int)origin.x,(int)origin.y,[[[screen deviceDescription] objectForKey:@"NSScreenNumber"] intValue]); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment