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.
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

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

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

Title # Comments Views Activity
iSeries DB2 Query 2 97
dog bark java program 15 105
matchUp  challenge 6 68
Problem to open Excel file 15 172
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

791 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