Resizing active window

Discussion in 'Mac Programming' started by perper, Dec 15, 2009.

  1. perper macrumors newbie

    Dec 15, 2009
    Hi, i was wondering if its possible in the Cocoa or CGWindow api to access the current window and resize/set bounds?
  2. Catfish_Man macrumors 68030


    Sep 13, 2001
    Portland, OR
    Use the -setFrame: method and related methods on NSWindow.

    (this only works if the window is in your process)
  3. perper thread starter macrumors newbie

    Dec 15, 2009
    but is there any way to resize/move a window that is not in the same process?
  4. chown33 macrumors 604

    Aug 9, 2009
    Sailing beyond the sunset
    See this recent thread:

    There is no more direct API because that would violate security constraints, which isolate processes from one another unless they agree to accept requests from other processes. That agreement takes the form of an AppleScript scripting dictionary. The dictionary describes those things that other processes can manipulate. Things not in the dictionary can't be externally manipulated. There may be exceptions to this in some cases, but it is the general guiding principle.

Share This Page