Constraining App's Top Level Window Inside Another App's Window?

Constraining App's Top Level Window Inside Another App's Window?

Post by Larry Lind » Sun, 14 Oct 2007 18:43:16


Hi Folks:

I'm trying to build my first Document-oriented Model interface,
like Word, Excel and Internet Explorer use. I've been unable to
find a description on how this is done, so I've attempted to build
my own.

This interface is similar to MDI, but the tasks started by the
application have icons in the task bar, not the bottom of the
client window, as MDI has.

In this app, the parent process is a frame, and the frame has a
client window.

I'm using independent processes for the tasks started by the user,
because their icons are normally displayed in the task bar.

I'd like the child processes to be constrained to this client
window.

Making the child processes' windows children of the client window
is a natural method to constrain the child process windows, but this
puts the child processes' icons along the bottom of the client
window. Is there a method to put force these icons onto the task
bar?

I can think of several methods to clip the child processes'
top level windows.

I'd appreciate suggestions for performing this task.

Thanks
Larry
 
 
 

Constraining App's Top Level Window Inside Another App's Window?

Post by Sam Hobb » Mon, 15 Oct 2007 14:30:21

Are you sure you mean to say process? Are you sure you are creating multiple
processes? It is unusual, innefficient and unnecessary to do what you are
doing using multiple processes.

 
 
 

Constraining App's Top Level Window Inside Another App's Window?

Post by Larry Lind » Mon, 15 Oct 2007 19:12:08


Thanks Sam:

Yep, I mean process.

Did I mention that I've been unable to find anything about
designing one of these interfaces?

Can you point me to a resource?

From the perspective I have now, I can see that their may
be a simpler method for doing what I want.

I did want each child's icon to appear in the task bar,
and creating processes does accomplish that. How would you
put icons in the task bar?

On the bright side, I have learned a great deal about
creating processes, and communicating with them using page
backed memory mapping.

Things are working pretty well, so while I'm interested
in the recommend method of building this interface, I'd
like to move forward with what I have.

I'd like to get what I have now working, and then I'll
take another look at the decisions that have brought the
project to this point.

Since I've posted, I've tried having the child process
open a child dialog with the parent's client window as the
parent of the dialog. Things seem to just freeze. I've
tried both modal and modeless child dialogs.

If there is no way forward I'll retrench, but this is
where the project is now, and I'd like to close the deal
if possible.

I do appreciate your input.

Thanks
Larry
 
 
 

Constraining App's Top Level Window Inside Another App's Window?

Post by David Lown » Mon, 15 Oct 2007 20:41:07

> Did I mention that I've been unable to find anything about

The MFC App Wizard allows you to create an MDI doc/view application
that has multiple top level windows (in the same manner as newer
versions of Word) - though they're not constrained to any frame as you
mentioned initially.

Dave
 
 
 

Constraining App's Top Level Window Inside Another App's Window?

Post by Larry Lind » Mon, 15 Oct 2007 21:46:25


Thanks Dave:

I'm not using MFC. This is C++ with VC6, using WIN32.

I though constraining a document to the application's frame was
a feature MDI, and the Document-oriented model used by Word, Excel,
and Internet Explorer.

I've posted a question about a specific attempt I'm making to
get this to work below.

I appreciate the information you offer.

Thanks
Larry
 
 
 

Constraining App's Top Level Window Inside Another App's Window?

Post by David Lown » Tue, 16 Oct 2007 03:49:54

> I though constraining a document to the application's frame was

It used to be, and Excel seems to still work that way, but Word
certainly isn't like that in newer versions, Word's windows are
unconstrained top level windows.

Dave
 
 
 

Constraining App's Top Level Window Inside Another App's Window?

Post by Alexander » Tue, 16 Oct 2007 08:35:30

Even though document windows are (quasi)independent top level windows, when
a modal dialog is open, it has to explicitly disable all top level windows,
not just the relevant document's window. Otherwise you risk running wrong
modal loop for other documents.
 
 
 

Constraining App's Top Level Window Inside Another App's Window?

Post by David Lown » Tue, 16 Oct 2007 16:13:56

>Even though document windows are (quasi)independent top level windows, when

I hadn't noticed that Word did that, but you're right it does.


Can you elaborate a little more, I don't understand what the problem
is?

Dave
 
 
 

Constraining App's Top Level Window Inside Another App's Window?

Post by Sam Hobb » Tue, 16 Oct 2007 19:24:49


It is still not clear to me what type of interface it is you are asking
about. I hope that the other replies have helped. As best as I understand
what you are asking about, the main thing is that the taskbar has buttons
for unowned windows.
 
 
 

Constraining App's Top Level Window Inside Another App's Window?

Post by Sam Hobb » Tue, 16 Oct 2007 19:27:04


Constraining a document to the application's frame is fundamentally
inconsistent with buttons on the taskbar for the document.

Does that help?
 
 
 

Constraining App's Top Level Window Inside Another App's Window?

Post by Alexander » Tue, 16 Oct 2007 22:36:14

App's top level modal loop can be structured differently than some modal
dialog's modal loop. If one document's window runs a modal dialog, you don't
want to execute another document's menu commands in that dialog's modal
loop. Not even talking about another can of worms, when *both* document
window would open modal dialogs, and the user would close them in wrong
order. That would be a complete disaster.

In other words, you don't want to have a modal dialog _and_ enabled
top-level window in the same thread.
 
 
 

Constraining App's Top Level Window Inside Another App's Window?

Post by David Lown » Wed, 17 Oct 2007 00:34:01

>App's top level modal loop can be structured differently than some modal

True - but see my comments below...


I'd have thought that if that were an issue it would surely imply a
design problem in the application. If messages should always be
processed by something done in the main message loop then that
processing is in the wrong place. It's essentially the same issue as
losing messages from PostThreadMessage when a modal dialog is shown.

Maybe Word does have that design limitation, I don't know, but I don't
see that it's a general one that ought to exist.

I can see that it might disable all top level windows because some
commands may need to operate on all windows (like Exit) and trying to
accommodate that when a modal dialog is open might be very messy.

Dave