Resizing active window

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

  1. perper macrumors newbie

    Joined:
    Dec 15, 2009
    #1
    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

    Catfish_Man

    Joined:
    Sep 13, 2001
    Location:
    Portland, OR
    #2
    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

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

    Joined:
    Aug 9, 2009
    #4
    See this recent thread:
    http://forums.macrumors.com/showthread.php?t=807225

    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