Using modal window??

Hi

I have several dialogs that interact with each other through buttons.
When a certain dialog appears I want it to be the focus until it is
destroyed.  The user should not be able to click anywhere in the
application apart from this dialog.

I currently have this working but the user can still click on the
originating dialog, any ideas?

Thanks in advance

0
5/19/2005 2:49:54 PM
vc.mfc 33608 articles. 0 followers. Follow

4 Replies
457 Views

Similar Articles

[PageSpeed] 43

Seems like you are using Modeless dialogs, why don't you use modal dialogs
instead?

AliR.

"wallacej" <jamie_r_wallace@yahoo.co.uk> wrote in message
news:1116514194.474219.83260@f14g2000cwb.googlegroups.com...
> Hi
>
> I have several dialogs that interact with each other through buttons.
> When a certain dialog appears I want it to be the focus until it is
> destroyed.  The user should not be able to click anywhere in the
> application apart from this dialog.
>
> I currently have this working but the user can still click on the
> originating dialog, any ideas?
>
> Thanks in advance
>


0
AliR1 (391)
5/19/2005 2:56:45 PM
can you explain how to use modal dialogs?  I have looked for help but
it all relates to creating objects.  Im creating the dialog using the
design tools in Visual C++.NET.  You'll have to excuse me as I'm very
new to using C++ GUI

thanks in advance

wallace

0
5/19/2005 3:27:46 PM
Designing your dialog has no significance on whether it's modal or not,
though the defining it as a CHILD might not work out the way you want it.
Anyway, the way you display a modal dialog is by calling the CDialog's
DoModal() Method, vers calling CDialog's Create method.


CMyDialog Dlg;
Dlg.DoModal();

AliR.

"wallacej" <jamie_r_wallace@yahoo.co.uk> wrote in message
news:1116516465.980211.84330@o13g2000cwo.googlegroups.com...
> can you explain how to use modal dialogs?  I have looked for help but
> it all relates to creating objects.  Im creating the dialog using the
> design tools in Visual C++.NET.  You'll have to excuse me as I'm very
> new to using C++ GUI
>
> thanks in advance
>
> wallace
>


0
AliR1 (391)
5/19/2005 3:53:44 PM
Hi

I've had a look at the suggestions on modal dialogs and I am still
confused.  The method used to create the dialogs is the same as in the
following tutorial (I am maintaining previously written code):

http://cpp.enisoc.com/articles/dialogs/

The DialogBox() function is used to create the modal dialog boxes as
the tutorial suggests.

if(DialogBox((HINSTANCE)hinstDLL, MAKEINTRESOURCE(IDD_PROPERTY), hWnd,
(DLGPROC)ShowPropDlgProc) == -1) 		MessageBox(NULL, "Unable to open
property dialog", "Error", MB_OK|MB_ICONSTOP);//if not error

When the dialog pops up it is possible to click and use the other
windows in the application, which I do not want to happen.  Can anybody
tell me why?  You'll have to excuse me if I've posted this on the wrong
forum.  I'm very new to C++ and its different environments and I've
sort of been thrown in the deep end! Which is fun!

Wallace

0
5/24/2005 11:42:19 AM
Reply:

Similar Artilces:

WM_QUERYCENTERWND and detecting creation of modal window.
I found that, the parent window is receivinig WM_QUERYCENTERWND when new modal window is started under that parent. I can capture that message in method CDialog::WindowProc. Capturing WM_QUERYCENTERWND is better then capturing WM_ENABLE, because when UI is multithreaded, it is possible to have two or more modal windows simultaneously connected to one parent (each modal window on separate thread). When second modal window is connected to parent window, I don't receive WM_ENABLE, but I receiving WM_QUERYCENTERWND each time when new modal window is shown. I need to count how many mo...

Can we use group policy templates for Outlook client options
Hi there, We are looking to automate the CRM outlook client settings so we don't have to manually change them for each user. Is there any way we can do this through group policy or another way? It would be handy if we had a list of registry settings that we could use? Thanks ...

Unable to use Word as email editor with outlook 2003 and exchange server
I am Unable to use Word as email editor with outlook 2003 and exchange server. Does anyone have a reason for this and/or a work-around so that I can use MS Word as the email editor. I have reviewed the knowledge base and cannot find a solution. Please help. Thanks, HR HR <anonymous@discussions.microsoft.com> wrote: > I am Unable to use Word as email editor with outlook 2003 > and exchange server. Define "unable". What happens when you try. What version of Word? -- Brian Tillman ...

How can I put text in a circle using Publisher ?
Have looked everywhere for an answer to this ? : How can I put text in a circle while using Publisher ? If I want to surround a shape or piece of clipart with words, I often need to have text in a circular or oval shape ........ surely this can be done with Publisher. Thanks for any expertise. DixieWins wrote: > Have looked everywhere for an answer to this ? : How > can I put text in a circle while using Publisher ? > > If I want to surround a shape or piece of clipart with > words, I often need to have text in a circular or oval > shape ........ surely this can be ...

How to write text to command prompt console windows?
I am using VC++ 6.0 to build a windows based application, however, my application allows user to input command arguments in the dos prompt windows. I want to have a warning message for user if they have input the wrong arguments. How can I write text to the dos prompt windows if user input the wrong arguments? Thanks in advance. Steven. Steven wrote: > I am using VC++ 6.0 to build a windows based application, however, my > application allows user to input command arguments in the dos prompt > windows. I want to have a warning message for user if they have input the > wrong ar...

windows media player #11 08-10-10
Hello to all, I need some help from some of you. Friends send me e-mails sometimes that has short movies in them. The media player plays most of them. The ones that wont play has a pop up that says, This file does not have a program associated with it for performing this action. Create an association in the folder option control panel. I guess I am not smart enough to do this myself. I would appreciate any help from you people that are more savy than me. Thanks a lot Thomas Stevens "TJ STEVENS" <tsteve...

Windows Server 2008 Installation Error
Hi , I am trying to install WinServer 2008 checked build x86 in my computer but I get following error when I put the key: Windows Server 2008 Installation Error: Windows installation has encountered an error and needs to be restarted. i restart the installation but the problem happens again. any fix for this? Thanks, Are you booting from the installation media? -- Regards, Dave Patrick ....Please no email replies - reply in newsgroup. Microsoft Certified Professional Microsoft MVP [Windows] http://www.microsoft.com/protect "dfrg" wrote: &g...

Using the mail merge function from excell
Is there a way of using the mail merge function in word to set up a three column format of names and addresses. I need to do this without using the "label" format - as I need it in word domument format in order to be able to add and make changes in word. Thanks Sheila You may want to look into storing your data in excel (already has nice columns and rows) and using MSWord's builtin MailMerge to create the labels. You may want to read some tips for mailmerge: http://www.mvps.org/dmcritchie/excel/mailmerg.htm http://www.mvps.org/word/FAQs/MailMerge The first is from Davi...

Windows Explorer
One of my document folders has a bold heading that reads "Unspecified". The folder name is "2008". If I name it anything else, the heading disappears. What does this heading mean? -- ....Len -------- Original-Nachricht -------- > One of my document folders has a bold heading that reads "Unspecified". The > folder name is "2008". If I name it anything else, the heading disappears. > What does this heading mean? Maybe an answer: http://support.microsoft.com/kb/306554 Look into the second to last paragraph. Ber...

Priority Option on the MO Entry Window
Is there a way to set the default (Low medium or High) in the Manufacturing Order Entry Window? I would like it to default to Low, but it now defaults to medium... thanks! -- Doug Dear Doug, Actually it does not exist as option, but if you have VBA module registered, this will be easily customized, just add the form and the priority field to VBA and paste the following code lines: Private Sub Window_AfterOpen() Priority.Value = 1 End Sub Regards, -- Mohammad R. Daoud MCP, MCBMSP, MCTS, MCBMSS Mob: +962 - 79 -999 65 85 Great Package For Business Solutions daoudm@greatpbs.com http://...

how to use TrackPopupMenu last parameter
Hi, I need to make a menu that does not disappear. (Odd, yes. I need to let users edit menu resources at runtime and would like to display the menus as how they would actually look.) So I'm looking at CMenu's TrackPopupMenu function, whose last parameter is LPCRECT lpRect. I figure if I set this rectangle to be (0, 0, screen width, screen height), then even if the user clicks elsewhere on the screen, the menu won't disappear, right? I tried the following code and the menu still disappears when I randomly click elsewhere in the application. What am I doing wrong? void CMenuVi...

Viewing OWA using the Outlook Full Client Browser
I just tried to access my corporate email account using OWA from within the Outlook full client running on my personal machine. I find it quite funny that OWA serves up its non-IE version when displayed using browser built into Outlook. Not really considering Outlook is running in a much higher security configuration than Internet Explorer and has a lot of features disabled. Just curious; why are you accessing the OWA website via Outlook? Ask your email admin if they also offer direct access to the corporate email servers via Outlook Anywhere (RPC over HTTP). -- Robe...

Are user certs broken when used on a front end server?
Does a front end exchange 2003 SP2 server support requiring a user certificate? On the back end server requiring user certs works fine (but breaks Treo syncing). I therefore set up a front end server and two virtual servers (one just SSL for treos and the other for Outlook Web Access). If I require a cert on the front end virtual directory I want to use for Outlook Web Access and try it, IE presents a blank box for the user certificate (when it should present one of the installed user certificates). If the backend is configured the same way and a client connects, their user certs are display...

word freezes periodically when i am tracking changes, using endnote and inserting pictures from file
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel word freezes periodically when i am tracking changes and using endnote and when i am inserting pictures from file. i seem to have no other options but force quit then i get lots of recovered documents. i am doing doctoral study so my documents have endnote field notes and changes highlighted. <br><br>inserting pictures from file into a word document causes instant hanging. Judging from the array of causes you're listing I believe there may be several things that need to be addressed. Sinc...

can I use Publisher to set up signatures of 8 pages?
I neeed to print and bind a book. I can't find any way to set up and print in sgnatures of 8 or so pages. I seem to be limited to 4 page bookfold. Any ideas? Insert, page -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "traveller" <traveller@discussions.microsoft.com> wrote in message news:9FD3B5CB-8D56-49DE-B632-06617A54EBE7@microsoft.com... >I neeed to print and bind a book. I can't find any way to set up and print in > sgnatures of 8 or so pages. I seem to be limited to 4 page bookfold. Any > idea...

Open New Visio Drawing using VBA in Word?
Hi, We're creating new Word 2007 templates, and some of them require flowchart functionality from Visio. Our goal is to create a macro within the Word template to call Visio, open a new drawing and have a custom stencil set open for users to use. Users would then open create their flowchart/diagram in Visio, and it would update automatically into the Word template when Visio is closed. I'm using the following code to start Visio, however I'm stuck on where to go from there: Sub Visio() Shell "C:\Program Files\Microsoft Office\Office12\VISIO.exe", vbN...

Need to format text in header, but value is generated using VBA
This is a multi-part message in MIME format. ------=_NextPart_000_0006_01C6360C.2372C770 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello, I wanted to reference a cell value in my spreadsheet header and found = out how to do that using this function: Private Sub Workbook_BeforePrint(Cancel As Boolean) Dim WS As Worksheet For Each WS In Worksheets ActiveSheet.PageSetup.RightHeader =3D _ Format(Worksheets("Time Period Info").Range("B3").Value) =20 Next WS End Sub However, this leaves my text for ...

Can't e-mail from Word 2000 using Outlook 2002/XP
After "upgrading" Outlook 2000 SP-1 to Outlook 2002, I can't create a Word letter from within Outlook or send a file to a recipient from within Word. When I try to create a letter from within Outlook, I get the error "To use this feature you must install the version of Microsoft Word that matches the installed version of Microsoft Outlook". I've tried The Outlook 2002 "repair", and even uninstalled it and re-installed Outlook 2000 SP-1. In that configuration, the software worked fine. But when I "upgraded" again to Outlook 2002, it was br...

(MFC) How to use messages to communicate between CMDIFrameWnd and CScrollView?
Alright, so I tried to use AfxGetMainWnd() from inside a CScrollView-derived class to access a function inside of a CMDIFrameWnd-derived class. It worked under the "Debug" configuration, but I'm getting a nasty error under the "Release" configuration: Coil error LNK2019: unresolved external symbol "public: void __thiscall CMainFrame::setCurrRef(class ATL::CStringT<char,class StrTraitMFC<char,class ATL::ChTraitsCRT<char> > >)" (?setCurrRef@CMainFrame@@QAEXV?$CStringT@DV?$StrTraitMFC@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@@Z) referenced in function &...

How can I change the Z-axes of my window or dialog? #2
Hello, All: I am now meetting a problem that the sub-window( or sub-dialog) would not be shown out in front of the parent window, however, I just wanna let it be shown in front of my parent window. Is there anybody who knows how I can set the Z-axes with any function? Thanks in advance! ...

After retreiving from back up, I cannot use the button send and re
Note the subject. I just recovered my PC. I get all my files from back-up and was plesantly surpriced that even my accounts where filled in. But it looks like there's something wrong with Windows mail since I cant use the button sent and recieve anymore. I can use the button for each account separately and for sent or recieve but not the combibutton thats in the menu. Does someone have a sollution to this problem?? Karin "Muisje70" <Muisje70@discussions.microsoft.com> wrote in message news:BEAE122D-2D48-40DE-B6E4-B472D81031C9@microsoft.com... > Not...

windows update fail...... What now?
ok so I had a problem with windows update downloading but not installing.. I did go to the windows file in the C: drive and manually installed it myself. Thinking that it would fix my install problem.. I was wrong.. I next have found out that in my event logger that my IIS6 is not working properly or something. It doesn't look right and in my event logger it says my security assessment tool 4.0 error 1303 I am the administrator and logged in already so what the heck? And I also would like to say that my computer is old and it's a IBM think pad running windows xp perfessio...

unable to delete Windows.edb file
I am trying to delete my Windows.edb file which is in C:\Documents and Settings\All Users\Application Data\Microsoft\Search\Data\Applications\Windows I have indexing service set to manual and off. I also have Microsoft Search disabled. But when I try to delete the Windows.edb file, I get a file in use message and it won't delete. What else uses it? I am also getting a bungh of MSSBC4xx.log files that show up in the same folder. There are about 50 of them now. Where do they come from? And is it related to my being unable to delete the ..edb file? Thanks, ...

maximize window
A co-worker worked on an Excel spreadsheet that we both use and Saved it. Now, when I open it, the workbook window is not maximized nor can I because the 3 buttons in the upper right corner of the window (Minimize, Maximize and Close) are nowhere to be found. The co-worker is unavailable for me to ask him what he did. How do I get the 3 buttons back so that I can maximize the window? TIA David Two options. If the title bar is just off the screen and you can't see it: Window|Arrange|Tiled (and resize the way you like it) If you can see the whole title bar, and that title bar is...

Getting info from the last used cell
Currently I am adding many sheets together. I am using "Start Sheet" and "End Sheet" and everything in between those two sheets is adding for a total. I would (in a few cells) to just get the data from the last cell used. Example: The sheets I am adding are dates and if sheet 01-19-09 (dd-mm-yy) has the last entry in cell c18 I would like that number. However there may be blank cell before that sheet. and after that sheet there will be info in other cells. I would like that info to go into c18 of the sheet I use and named "Totals". -- Ed Davis ...