I'm trying to control windows of a foreign OSX applications from my application. I'd like to 1. move the windows on the screen 2. resize the windows on the screen 3. change the currently active window of the application 4. get the currently active window.
(And I'd like to do this either through ObjC/C/C++ apis).
What are the API calls that I should be looking for, considering that I have the CGWindowIDs of the windows that I want to control? That is, I'd expect to find functions with signatures of something like: MoveWindow(CGWindowID winId, int x, int y)
, ResizeWindow(CGWindowID winId, int width, int height)
, Activatewindow(CGWindowID winId)
, CGWindowID GetCurrentlyActivatedWindow()
.
For 3, I'm already using SetFrontProcess
to pull a process to be up front, but this doesn't let me select the specific window of a process if it has multiple.