Child windows not subordinated to the frame?

Hi!

I would like to implement an application with several child windows, who behave like mainframes...
Compare to Outlook, where Outlook itself is a MainFrame with a menu and a treecontrol and a listbox. And every child of the frame (a single mail) is not bound to the mainframe...

What classes do I need? A MDIFrameWnd with FrameWnd as childs?  

Who can help me?

Thank you
KnallarAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
plarocheConnect With a Mentor Commented:
Use a simple CWnd derived class, or even a dialog or anything you wish. It all depends on what you need to do.

As for Outlook, let's say you wanted the same behavior well you could create a childframe and let have it float with the parent as desktopwindow
0
 
FargoCommented:
Yes you have to use the Multiple Document Interface (MDI) in your application. You can specify that, when you create your project with the MFC App Wizard. After doing so, the framework creates for you 3 classes connected to the MDI model: a document derived from CDocument, a main frame derifed from CMDIFrameWnd, and child frame class derived from the CMDIChildWnd. This is the answer to your question about the child windows. They SHOULD be derived from CMDIChildWnd, because this class works in conjunction with the MDICLIENT object, which is a member of the main frame window. And one thing more: in order to use the Document/View architecture, you have to create a CMultiDocTemplate object in your App's InitInstanse(). But this is just another thingie the AppWizard of VC++, that does for you.
I will recomend to create an MDI project with the AppWizard (just start it and read carefully and check everithing that's connected to the MDI). Then I will propose you to take a look at what MSDN says about the MDI architecture and what MFC classes are involved.

I hope, I was help :)
0
 
FargoCommented:
And by the way, the Outlook child windows are NOT child windows to the MainFrame, but they are separate applications. Take a close look to the taskbar, and you'll see that every new mail window is registered there, and if you have PView you'll find them as standalone applications. You can do that easy if you start the other applications (which represent the false childs) from the main window.
0
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

 
KnallarAuthor Commented:
Hmmmm fargo...
I didn't want MDIChilds...
I need to have childwindows, which can be placed anywhere on the desktop not only inside the CMDIFrameWnd.
If I use the common MFC-MDI-architecture, I get the case you described above.
But then my childs are inside the Frame and I'm not able to place them anywhere I like.
0
 
Answers2000Commented:
For outlook style UI, try this page
http://www.codeguru.com/advancedui/index.shtml

The articles that probably interest you are
#1 An Outlook98 bar-like control - Iuri Apollonio (1998/08/01)
#2 Outlook 98' style UI - Kirk Stowell (1998/08/22)

Article #1 creates a splitter in the mainframe (actually a derived class of CSplitterWnd) and then a custom control in the LHS

Article #2 is probably more directly relevant to your question as I undertand it
0
 
FargoCommented:
Hmmmm knallar...
Did you read my comment? You want to create some pop-up child windows...
Let me think...you can do something over the window style of the child windows. But see what the MS documentation states about the window styles (and let me notice that this is a part of the A-B-C of the Windows programming):

WS_CHILD :
Creates a child window. Cannot be used with the WS_POPUP style.
 
WS_POPUPWINDOW:
Creates a pop-up window with the WS_BORDER, WS_POPUP, and WS_SYSMENU styles. The WS_CAPTION style must be combined with the WS_POPUPWINDOW style to make the Control menu visible.

.and to be more clear, I include the description of what a pop-up window is:

pop-up window :
A special type of overlapped window typically used for dialog boxes, message boxes, and other temporary windows that appear outside an application's main window.

So, you CANNOT create a CHILD window that is POP_UP also
PLEASE READ MY PREVIOUS COMMENT.
I'm sorry that I was not helpful, but as I stated already you can start your "child" windows as standalone applications as your favourite Outlook does.

Sincerly yours
Fargo
0
 
FargoCommented:
Hmmmm knallar...
Did you read my comment? You want to create some pop-up child windows...
Let me think...you can do something over the window style of the child windows. But see what the MS documentation states about the window styles (and let me notice that this is a part of the A-B-C of the Windows programming):

WS_CHILD :
Creates a child window. Cannot be used with the WS_POPUP style.
 
WS_POPUPWINDOW:
Creates a pop-up window with the WS_BORDER, WS_POPUP, and WS_SYSMENU styles. The WS_CAPTION style must be combined with the WS_POPUPWINDOW style to make the Control menu visible.

.and to be more clear, I include the description of what a pop-up window is:

pop-up window :
A special type of overlapped window typically used for dialog boxes, message boxes, and other temporary windows that appear outside an application's main window.

So, you CANNOT create a CHILD window that is POP_UP also!
PLEASE READ MY PREVIOUS COMMENT.
I'm sorry that I was not helpful, but as I stated already you can start your "child" windows as standalone applications as your favourite Outlook does.

Sincerly yours
Fargo
0
 
plarocheCommented:
To have child windows not subordinated to the frame you don't really have to start other applications.  It can be done also by making you popup child windows children of the desktop window.

You retrieve the desktop window with GetDesktopWindow(), use that pointer as a parent to the child window you will create.  Beware not to store the pointer across messages, it may become invalid. You can safely store the HWND though.

Doing this will also make a new icon for the window on the taskbar. And it will also make the windows standalone.
0
 
KnallarAuthor Commented:
O.K... sounds logical...

Now... simply tell me what special classes of the mfc I have to use...
A CFrameWnd and as the new "child" also a CFrameWnd with it's parent set to the desktopwindow?
0
 
FargoCommented:
Knallar, do you want me to go there (whereever you are) and develop the prog for you?
If so, just send me your address (country, state, street...etc.) and I'll be there in a minute...
0
 
FargoCommented:
...And no special classes. You guessed it would be CFrameWnd window with the styles and actions plaroche proposed you. I don't understand, why you reject answers that seem logical to you?!
0
All Courses

From novice to tech pro — start learning today.