title: Controlling OSX windows
body: <p>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.</p>
  
  <p>(And I'd like to do this either through ObjC/C/C++ apis).</p>
  
  <p>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: <code>MoveWindow(CGWindowID winId, int x, int y)</code>, <code>ResizeWindow(CGWindowID winId, int width, int height)</code>, <code>Activatewindow(CGWindowID winId)</code>, <code>CGWindowID GetCurrentlyActivatedWindow()</code>.</p>
  
  <p>For 3, I'm already using <code>SetFrontProcess</code> 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.</p>