views:

269

answers:

5

I was wondering, how would you go about writing an application that basically houses other applications inside of it?

The reason I ask is that I'd love to build an app that 'conquers' my current explosion of open windows. I've used virtual window managers before and they're nice and all, but I could do so many things with an app like I mention.

Alternatively does anyone know of an easy to use/intuitive application for confining windows to 'regions' of your screen? Something like GridMove, but more intuitive and less flakey?

A: 

Multiple Document Interfaces could help you out.

Despite the multiple down votes, I stand by this answer because the OP never stated the source of the "explosion of windows." I've seen business apps that open several windows at a time (or users that would open several instances "to save time") where MDI would've been a nice feature for them.

If the OP is a power user who has a need for another window manager because he runs many apps at once, then this really doesn't apply. It also isn't the problem I'd be addressing -- it would be finding a way to have fewer windows.

Austin Salonen
Did you actually read the question? I don't think MDI is going to be a window manager replacement for the OP.
Geoffrey Chetwood
Sorry if I wasn't clear, but yes, explosion of windows meaning multiple application windows. What I'm basically trying to create is an application that acts as an MDI for *other* applications - that is, ones it doesn't own. dreamlax's suggestion sounds like it might work.
Eddie Parker
+1  A: 

I think what you are describing is generally called a Window Manager. The Windows shell is itself a (poor) example of a window manager. You might want to investigate some alternatives. I know there has been some success in getting KDE ported to Windows, so you might want to look at the current state of that project.

Microsoft also provides a PowerToy (IIRC) that gives you virtual desktop support, but it's really bad. Have you considered just getting a second monitor (and perhaps a utility such as MultiMon Taskbar to get a second task bar on the other monitor)?

rmeador
+1  A: 

You could create a window, then you could enumerate all Windows that have the style WS_OVERLAPPEDWINDOW, select the ones belonging to the application you want to house, then call SetParent on the window, setting the parent to the window you created. You could also use FindWindow to find a window by its title.

All the windows inside the house can never leave the house window's boundaries, but they still follow all the same rules. You can still click-and-drag windows etc.

The problem here is that if the application inside the house creates another window, its parent will most likely be the desktop window, not the house window.

dreamlax
Hrmm, this sounds interesting. I could probably do a windows hook to catch new window creations and reparent after that if that's the only side case you mention.I'll have to give this a shot, thanks dreamlax, that sounds near to what I want.
Eddie Parker
A: 

In general, there's always a VM.

It may be overkill or it may not work depending on the specifics of what you're trying to do. But VMWare will let you copy/paste files and text between your VM and local machine, so it's not that far off of being a true window manager. The system requirements aren't even that outrageous, considering how much memory iTunes + a typical browser eat up.

patros
+1  A: 

Here is code that uses FindWindow / SetParent to create a tabbed view combining different applications Jedi Window Dock

I also wrote an application (not free, not open source) that takes this idea a bit further called WindowTabs.

The only caution I would give you is that not all applications like being parented. If your writing .NET, there are some "Gotcha's" there (which is why WindowTabs doesn't use parenting).

Also, in general, once you do a SetParent, you are joining the threads at a Win32 level meaning that if one hangs, all of them are toast.

Mo Flanagan
I imagine you didn't mention this in your post as it's probably WindowTab's 'secret sauce', but what does WindowTabs use then, if not parenting?
Eddie Parker
I wish I was clever enough to have secret sauce! Basically I just use MoveWindow and SetWindowPos along with injecting a hook into the child processes to synchronize the docking window and the docked window. I'll put up a blog article about the architecture and update this with a link at some point.
Mo Flanagan
claws
I don't want to turn my response into more of a shameless plug for my product :) Email me and I would be happy to answer any questions you have about the architecture.
Mo Flanagan