I puzzled for a few hours over this the other night - it’s something that used to work in VirtueDesktops, and for some reason I just assumed it no longer functioned under Mac OS X 10.5. Aside from an embarrassing bout of forgetting to get the window number properly, this turned out to be remarkably simple.
You’ll need a copy of the CGSPrivate header in your project.
Simply use the following code, where
ibo_window is an Interface Builder outlet to an NSWindow in your XIB file:
Easy, huh? I’m pretty sure this won’t work across processes (that’s why all the old desktop managers insert code into the running Dock application - it’s one of the only applications that has permission to muck about with other application’s windows). You should also probably try to intercept any errors thrown by the
CGS* methods, but I’ll leave that as an exercise to you, gentle reader.