Solved

Child windows not subordinated to the frame?

Posted on 1998-10-06
11
303 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

735 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