Skip to content

Instantly share code, notes, and snippets.

@stek29
Created May 16, 2017 22:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stek29/79ae0de955313c5d7b90f144adba3c69 to your computer and use it in GitHub Desktop.
Save stek29/79ae0de955313c5d7b90f144adba3c69 to your computer and use it in GitHub Desktop.
// Very simple program to print all windows
// Obviously needs `-framework CoreGraphics -framework Foundation`
#import "CoreGraphics/CoreGraphics.h"
#import "Foundation/Foundation.h"
int main(void) {
NSArray *arr = [(NSArray *) CGWindowListCopyWindowInfo(kCGWindowListOptionAll, kCGNullWindowID) copy];
NSLog(@"%@", arr);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment