A Popping up multiple smaller windows on an SDI document

Posted on 2000-04-01
Last Modified: 2013-11-20
I have an SDI document and a ListCtrl. When i right click on the listctrl i want to have a window to pop up showing information on the selected item. Ive been reading up on CFrameWnd and CMiniFrameWnd but there seems to be no examples on how to use them...

anyway, inside the  PopUp window shud also contain other controls. The window should be modeless as i want to pop up as many windows dynamically until the user closes the these window...

any sample projects on how i can achieve this???

ok thanks a bundle.
Question by:lamer

Expert Comment

ID: 2677072
Why do you want to use CFrameWnd or CMiniFrameWnd for such purpose? You probably should use CDialog.

Author Comment

ID: 2677168
1) I dun want the taskbar to have the new window that i will pop up becoz the user can create multiple windows - dynamically

2) I need to check that the user does not pop up the same window twice.

3) The window must not be modal and as the program gets minimize all the windows shud be minimized as well and when it gets maximized the windows will still be in the same position as it was previously

Using CDialog would be an incredible hassle to achive the 3 tasks above
LVL 23

Expert Comment

ID: 2677205
Use a modeless dialog box with the WS_EX_TOOLWINDOW extended style.
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

LVL 10

Expert Comment

ID: 2678628
1) WS_EX_TOOLWINDOW gives a smaller border and stops the dialog from appearing in the task bar .. if you remove the WS_EX_APPWINDOW style.  See MS KB article HOWTO: Prevent a Window from Appearing on the Taskbar ID: Q205158

2) simply kill the previous one and pop up a new one (or see what I do below)

3) make the dialog modeless

Cannot see any great problem with that.

I do something very similar, and use a modeless property sheet.  I actually create this at the start of the program and tell it what item to 'look at' (ie when I get a right-click i tell the property sheet to update itself with the info for that item).  I also make the sheet initially invisible, and simply make it visibble when the user wants to see it.  I make the close [x] button hide the window rather than kill it so that it doesn't need to be re-created and so it can reappear at the same position and with the same page showing when I bring it up again.

NOTE: If all you wanted was info, an not other controls, I'd suggest a tooltip.

LVL 10

Expert Comment

ID: 2678629
That was supposed to be an answer

Author Comment

ID: 2682651
well... the dialog box needs to be dynamically created and destroyed... coz there can be more than 1 at any one time...

the reason why i use CFrameWnd is becoz of this.. i need to keep the pointers to the dynamically created windows...

i can't use tool tip coz the information is updated on a real time basis.. hence i need to have a CListCtrl inside the Window... if it was only 1 window I would definately use a dialog rather than a CFrameWnd

Creating it with CFrameWnd is quite a pain but do able non the less... ive sorta figured it out... but if u can give me the codes to a modeless dialog box that can be dynamically created then that will be great!

LVL 10

Accepted Solution

RONSLOW earned 100 total points
ID: 2682653
if you want more than one, then that is fine .. just create as many as you want.  If you don't, then delete old ones when new ones are wanted.

you simply need a modeless dialog.  Nothing special.  You just use Create instead of DoModal (basically).

But do you mean that the dialog content itself is dynamic (ie you cannot have adialog resource?).

This is also easy to do, just add controls to the dialog when it is created (in the OnInitDialog is good).

If there is lots of info, or a number of different dialog loayouts depending on the type of object, use a modeless property sheet, and add pages dynamically based on the type of object you are looking at.


Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Strange date stored 22 122
Pressing cancel button with C# UI Automation 3 68
windows 10 how make picture as desktop background 2 62
pre4 challenge 19 100
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

770 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