Independant Modeless CDialog

Hi,

I am having some serious difficulty with a problem of multiple windows in 
the same application. I use a CDialog as my main window, which is created in 
the main app call with DoModal, from it however, I wish to create several 
dialogs that are modeless, each has a taskbar entry (somewhat like MSN 
messenger) - However, whenever I click on any of these windows the entire 
job lot pops up, including my origional window.

I know in VB that everything was pretty independant, you could switch 
between windows at your chosing, and only toolbar windows would pop up, 
thats kind of what I am after here... I want multiple independant modeless 
windows shown in the taskbar, and I want only the ones associated with that 
window to pop up.

Is there any way of dissassociating a window with the window that created 
it?

-- 
- Mark Randall
http://zetech.swehli.com 


0
markyr1 (230)
6/1/2005 2:01:36 PM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
301 Views

Similar Articles

[PageSpeed] 5

Oh, one more thing... The blasted 2nd window also gets hidden when I disable 
the app window style on the main...

eugh.

-- 
- Mark Randall
http://zetech.swehli.com

"Mark Randall" <markyr@REMOVETHISgoogle.ANDTHIScom> wrote in message 
news:eHdhwJrZFHA.2916@TK2MSFTNGP14.phx.gbl...
> Hi,
>
> I am having some serious difficulty with a problem of multiple windows in 
> the same application. I use a CDialog as my main window, which is created 
> in the main app call with DoModal, from it however, I wish to create 
> several dialogs that are modeless, each has a taskbar entry (somewhat like 
> MSN messenger) - However, whenever I click on any of these windows the 
> entire job lot pops up, including my origional window.
>
> I know in VB that everything was pretty independant, you could switch 
> between windows at your chosing, and only toolbar windows would pop up, 
> thats kind of what I am after here... I want multiple independant modeless 
> windows shown in the taskbar, and I want only the ones associated with 
> that window to pop up.
>
> Is there any way of dissassociating a window with the window that created 
> it?
>
> -- 
> - Mark Randall
> http://zetech.swehli.com
> 


0
markyr1 (230)
6/1/2005 2:16:53 PM
On the whole, I found the Vb model of every-window-is-a-top-level-window to be a rather
horrible interface. 

The problem you have arsises because the modeless dialogs have the main app dialog as a
parent, so the relationship you see on the window popup and visibility is dictated by
that. I'm not sure it is possible to easily create an unowned top-level modal dialog in
MFC, because the default "NULL": parameter forces the main app window to be used as the
parent (instead of the desktop, which is what NULL would usually mean). There are two
opinions: one is that SetParent will change the parent, and the other opinion is that it
won't work right because the "real" parent is kept in an inaccessible internal location in
the kernel; since I never trusted it, I don't use it. 

VS.NET has an option to create multiple top-level windows, but I've not used that also. 

These ideas may suggest what you need to do in order to get the top-level windows you
want. But that's the best I can do on this one.
					joe
On Wed, 1 Jun 2005 15:01:36 +0100, "Mark Randall" <markyr@REMOVETHISgoogle.ANDTHIScom>
wrote:

>Hi,
>
>I am having some serious difficulty with a problem of multiple windows in 
>the same application. I use a CDialog as my main window, which is created in 
>the main app call with DoModal, from it however, I wish to create several 
>dialogs that are modeless, each has a taskbar entry (somewhat like MSN 
>messenger) - However, whenever I click on any of these windows the entire 
>job lot pops up, including my origional window.
>
>I know in VB that everything was pretty independant, you could switch 
>between windows at your chosing, and only toolbar windows would pop up, 
>thats kind of what I am after here... I want multiple independant modeless 
>windows shown in the taskbar, and I want only the ones associated with that 
>window to pop up.
>
>Is there any way of dissassociating a window with the window that created 
>it?

Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15979)
6/1/2005 4:29:54 PM
Reply:

Similar Artilces:

Independent dialogs
Hi all, I have a project with 2 dialogs, called CMyLoginDlg, CMyMainDlg First, my app begin to run, it will display a Login Dialog (MyLoginDlg variable ), then logining ok, it will display Main Dialog (MyMainDlg variable), In this time, we need also to go back Login Dialog for some reasons. My question, we can have any way to change m_pMainWnd variable in CMyApp::InitInstance() function, so user can still see my app on taskbar when i go back the Login dialog and hide MainDlg? Currently, m_pMainWnd variable point to MyMainDlg variable. When i go back Login Dialog, i need to hide Main...

Problem calling OnMouseMove for CButton in CDialog
I have a CDialog with a custom control JS in it that inherits from CButton. (It's a groupbox button with some other child controls in it). I'd like to catch the WM_MOUSEMOVE event for this control. However, nothing happens when the mouse moves over the control. In JS.h, I have //{{AFX_MSG(JS) afx_msg void OnMouseMove(UINT nFlags, CPoint point); //}}AFX_MSG and in JS.cpp, I have BEGIN_MESSAGE_MAP(JS, CButton) //{{AFX_MSG_MAP(JS) ON_WM_MOUSEMOVE() //}}AFX_MSG_MAP END_MESSAGE_MAP() The callback function is defined as this: void JS::OnMouseMove(UINT nFlags, CPoint point) { SetWin...

COmpany Independent
All, Is User Class company independent? I mean once we define a user class, will it be visible in all the companies? Pavan Yes, once you define a user class it will be available in all your GP companies. -- Victoria Yudin Microsoft MVP - Great Plains "Pavan" <Pavan@discussions.microsoft.com> wrote in message news:1CF20C4A-2F2D-4DDE-A9D6-A9445EBA5F74@microsoft.com... > All, > > Is User Class company independent? I mean once we define a user class, > will > it be visible in all the companies? > > Pavan > ...

Can you have multiple, independent clipboard entries simultaneousl
Very often I want to copy and paste several different, widely separated things from a web page and it would be great if after Control C you could do a Control Something Else and then a Control Something Elser and have them all in your clipboard when you're ready to paste. (Of course you'd also have to have a Control V then Control V1 and Control V2 or its equivalent.) Is this possible? I have a cheap pocket calculator with 3 different memory stores so there is precedent. -------- Original-Nachricht -------- > Very often I want to copy and paste several dif...

Independently set columns windows live mail (IMAP)
I'm having problems with the with windows live mail and the columns on my imap email account. If I change columns in the inbox the columns in the sent mail box changes to the also. How can I set the columns in each folder independently? I have no problems doing with with my pop account. Thanks in advance for any help. ...

can one cell contain more than one independent number
A cell can contain several numbers, separated by space characters or line breaks (Alt+Enter). However, if you want to perform calculations on the numbers, it's best to keep them in separate cells. John K wrote: -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html there's also the option a using matrix formula (list of data) for example you may enter ={1;2;3} in a single cell or selection 'and validate wih CTRL+SHIFT+ENTER but the manipulation of this kinda of formula need to read more about it... ...

modeless dialog and view redraw?
i have a view/doc app. when i open a modeless dialog which diaplsy some realtime data, the view do not redraw. when i scroll the view, the view redraw. why? i add a timer to CMyView. MyView.h //------ SetTimer(1, 100, NULL); //----- MyView.ccp //----- CMyView::OnTimer() { invalidrect(NULL); .... } BUT, the view do not redraw . why? thx! Try UpdateWindow either instead, or just after your invalidate call... Jase "rtlinuxman" <rtlinuxman@hotmail.com> wrote in message news:%237YzG6x3DHA.2000@TK2MSFTNGP11.phx.gbl... > i have a view/doc app. when i open a modeless d...

CDialog on top of all windows?
Hi, I have a class derived from CDialog. When I show this dialog I want it to be modal and display on top of all the windows, even those of other applications. This is needed because the dialog is being run through Automation and I want it to be 'On Top' of the other .exe and not the ..exe it 'belongs' to; preferably without the 1st .exe also being put on top. How can I do that? Thanks, Scott Metzger In the OnInitDialog() member function of your dialog call SetWindowPos(&CWnd::wndTopMost, 0,0,0,0, SWP_NOMOVE | SWP_NOSIZE ); -- Cheers Check Abdoul [ VC++...

Word is independently editing my manuscript
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel When I reformatted a book manuscript and repaginated, word - on its own (as unbelievable as that may be), changed some of the book characters names. For example, &quot;Mary called Joe on the phone&quot; became &quot;Mary called Mary on the phone.&quot; I didn't do any searches to change copy, I didn't have &quot;Mary&quot; or &quot;Joe&quot; in anything that would be autocorrected. <br><br>Can anyone tell me what might have gone wrong. I now have to proofread the e...

CDialog and border style
Hi Is it possible to change the border style of a dlg programmatically? The dialog i am using is used elsewhere and has no border, but I require one in my application. TIA Tony This might be what you need: http://www.thecodeproject.com/dialog/presubclasswindow.asp Tom "Tony" <lazyherbert@homeandresting.com> wrote in message news:eTYiaEOHGHA.2628@TK2MSFTNGP15.phx.gbl... > Hi > > Is it possible to change the border style of a dlg programmatically? > The dialog i am using is used elsewhere and has no border, but I require > one in my application. > &...

Independent Column Widths
Hoping someone here can help me figure this out. I need to have two seperate and independent column widths for the same spreadsheet. Such as this: Top Portion of Spreadsheet [-----------][---------][----------------] Bottom Portion of Spreadsheet [-----][------------------][------------------] The column width of each portion needs to not affect the other portions of the spreadsheet. Merging cells would be too time consuming. Any assistance would be appreciated. each column has a setable width, it cannot change for different rows If you post more specifically what you want, there is like...

Independent Subform
I've embedded a sub-form into a main form by dragging it from the forms list into the main form. I want there to be one sub-form record per main form record (a one to many relationship, with the sub-form having many fields). However, when I browse through the records on the main form, the sub-form still remains on the same record. I've tried to adjust the relationships as follows. Table = Status Report, Related Table = Design Phase, Primary Keys for both are Report No. I've chosen to Enforce Referential Integrity. With these settings the Relationship Type is set for me...

Size Dialog independant screen
Hello, I want my CDialog would have the same size on any screen resolution. I have developped my dialog on 1152*864, I don't want my dialog would be out the screen workarea if the screen resolution is 800*600. How can I do that ? Thierry I did a re-sizing dialog recently for a WebCam app. In my case, when the user selects a different video resolution the dialog re-sizes to accomodate. The same technique would work for your case, just get the screen size and use the result to re-size the dialog as follows (this also shows how to move controls around to keep them visible, but it doesn&...

strangely modeless dialog working even when i didnt destroy object
hello, I ahve created a dialog based application.I have inserted 6 menu options voz dialog1,dialog2,dialog3,....dialog6 in the dialog .On clicking of these menu opions i am popping 6 different modeless dialog.here is the code written for it midialog *d;//class for dialog resource d=new midialog; d->Create(IDD_DIALOG1); d->ShowWindow(SW_SHOW); To close it i either click on OK or Cancel or Red cross button and then i close the parent window.It strangely doesn't give an error.I was thinking that for modeless dialog you need to override OnCancel,OnClo...

Independent Lists...
I am familiar with creating lists in excel, however, I need help on a formatting issue. Once I have more than one list, I can select an item from one list without it automatically pulling an item in another list from the same corresponding row. Is there a way to get my lists to act independently of each other? "Corey" <Corey@discussions.microsoft.com> wrote in message news:A7A9C741-54C1-440F-9C49-8A80DE7277CA@microsoft.com... >I am familiar with creating lists in excel, however, I need help on a > formatting issue. Once I have more than one list, I can select an ...

modeless MDI
Oh heck..., This is what I'm trying to do. What's the best way forward? I want to have a "CONTROL" panel. Which contains a list of objects. I wanto be able to click on the objects to open a window to edit its properties. I'd liike to be able to open ultiple nstances of the window. I guess this sounds like an MDI? I want also to be able to click on bits of the control panel to open up modal dialog winodws to edit other properties, e.g. add another item to the list. I have a feeling that my mouth is bigger than my stomach. I'm not even meant to be a programmer.... I...

Independent Forms
Is it possible to "externalize" forms form Access, so they can be used to edit tables without launching MSAccess itself? Maybe give them a shortcut to be placed on the desktop, so they would launch as an independent program? Thanks for your answer in advance- Hi I was about to ask exactly the same question. The last time I used Access was in 98 with Windows NT. I ran an Online Access (no relationship) in Tasmania. When we had new members in we clicked on an icon on the desktop, which opened up a form where we put in their details. This form was completely independent to th...

CDialog background color in CTabCtrl
Hi, I have a dialog box that is child of a CTabCtrl control. When I select a tab, a new dialog box is displayed similar to what property sheets are doing. However when I display the dialog the background color of the dialog is not the one of the tab control (the parent). How can I change the background color of the dialog to be the same as the one of the tab control? I tried OnCtlColor(...) but this allows me to change the background color to a fixed predefined color. In other words I want that my dialog is not visible in the tab control, only the dialog's controls should be visi...

Resolution Independant Drawing
Hi, How can i draw a line that measures 10 inch/cm on all resolutions. I tried it with other mapping modes.But I find the things does nt seem to work out for me. If anyone of you know the solution pls help Thanks in advance, Zameer ...

CDialog & CEdit #2
I'm developing an app in C++ using VS.net. I've created a CDialog derived class called CDlgMemo. I've added a CEdit control variable to the CDlgMemo class called m_memo. In OnInitDialog() I initialize m_memo using the SetWindowText( ) method. When I execute this I get an ASSERT (see below) indicating that the CEdit control does not have a CWnd handle. This is very straight forward stuff I've done many times before. Any Ideas what's going on???? void CWnd::SetWindowText(LPCTSTR lpszString) { ASSERT(::IsWindow(m_hWnd) || (m_pCtrlSite != NULL)); if (m_pCtrlSite == ...

Columns working independently
I'm trying to get two columns on one page and have the columns work independently of one another. Right now if I hit the tab button the other column gets all screwy. How do you get the two columns to work independently? I don't know what you mean by "work independently," but if you use a table with two columns, you can do whatever you'd like in them, separately. On Jan 11, 4:29=A0pm, peatreg <peat...@discussions.microsoft.com> wrote: > I'm trying to get two columns on one page and have the columns work > independently of one another. =A0Righ...

Embed a modeless cdialog derived object into a cformview derived object
I am creating an mfc application and would like to know if this is possible at all (not very experienced with MFC). I have an SDI application with a CFormView derived object. Inside this form I want to embed a CDialog derived modeless dialog which contains controls that I want to reuse throughout the application (a few edit boxes, a couple of buttons). I'm at the point where the CFormView gets displayed, and at this moment I want to embed in it my dialog object. First of all: am I going about this the right way in trying to reuse a dialog? I tried the following code: CSelectOriginType i...

Need GP independant consultant for Chicago Area
We are starting to implement GP in our office, and would like to find an independant GP consultant in the area. Pleae just reply to this. We use Crestwood Associates www.crestwood.com "Rick Neubauer" wrote: > We are starting to implement GP in our office, and would like to find an > independant GP consultant in the area. Pleae just reply to this. Hi Rick, Flip me an email and I can connect you to a local resource. -Mike -- Micheal LoPatriello Coordinator, Luna Development mlopat@lunadevelopment.com http://www.lunadevelopment.com "Rick Neubauer" wrote: >...

Window is minimized after destroy the modeless dialog
I am working on a program which will load some XML files. Right after user select a file from the browse dialog, I created a modeless 'Loading file ...please wait' dialog box , the modeless 'please wait' dialog box is destroyed using destroyWindow() after the loading is completed. The problem is : when the modeless dialog is destroyed, my main dialog is minimized. What can I do to avoid the main dialog being minimized? Here is part of my code: void CMainFrame::OnFileImport() { CProgressBar* pDlg = new CProgressBar; VERIFY( pDlg->Create() ); pDlg->SetWindowPos(&...

CDialog:CreateIndirect()
Hello , I am trying to create a Dialog Box without using a .rc file, but I am not getting it , i tried it by using CreateIndirect function and DLGTEMPLATE structure. Please help me. - niraj ...