Solved

Child windows not subordinated to the frame?

Posted on 1998-10-06
11
312 Views
Last Modified: 2013-11-20
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
0
Comment
Question by:Knallar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 2
  • 2
  • +1
11 Comments
 
LVL 1

Expert Comment

by:Fargo
ID: 1323008
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
 
LVL 1

Expert Comment

by:Fargo
ID: 1323009
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
 

Author Comment

by:Knallar
ID: 1323010
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
Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

 
LVL 8

Expert Comment

by:Answers2000
ID: 1323011
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
 
LVL 1

Expert Comment

by:Fargo
ID: 1323012
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
 
LVL 1

Expert Comment

by:Fargo
ID: 1323013
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
 
LVL 3

Expert Comment

by:plaroche
ID: 1323014
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
 

Author Comment

by:Knallar
ID: 1323015
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
 
LVL 1

Expert Comment

by:Fargo
ID: 1323016
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
 
LVL 3

Accepted Solution

by:
plaroche earned 50 total points
ID: 1323017
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
 
LVL 1

Expert Comment

by:Fargo
ID: 1323018
...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

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question