Created
September 19, 2015 20:03
-
-
Save freysie/d58dbd966548cb1d7059 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class Window { | |
let element: AXUIElementRef | |
init?(processID: pid_t) { | |
element = AXUIElementCreateApplication(processID).takeRetainedValue() | |
} | |
var processID: pid_t { | |
let pointer = UnsafeMutablePointer<pid_t>.alloc(1) | |
AXUIElementGetPid(element, pointer) | |
let value = pointer.memory | |
pointer.dealloc(1) | |
return value | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment