Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
// 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