Solved

A Popping up multiple smaller windows on an SDI document

Posted on 2000-04-01
7
373 Views
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.
0
Comment
Question by:lamer
7 Comments
 
LVL 1

Expert Comment

by:sunj
Comment Utility
Why do you want to use CFrameWnd or CMiniFrameWnd for such purpose? You probably should use CDialog.
0
 

Author Comment

by:lamer
Comment Utility
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
0
 
LVL 23

Expert Comment

by:chensu
Comment Utility
Use a modeless dialog box with the WS_EX_TOOLWINDOW extended style.
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 10

Expert Comment

by:RONSLOW
Comment Utility
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.

0
 
LVL 10

Expert Comment

by:RONSLOW
Comment Utility
That was supposed to be an answer
0
 

Author Comment

by:lamer
Comment Utility
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!


0
 
LVL 10

Accepted Solution

by:
RONSLOW earned 100 total points
Comment Utility
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.

0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

772 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now