Closing a child Dialog when the Mouse button is clicked outside the Parent Dialog

Hai
  I Have a Parent Dialog and a ChildDialog associated with that and when the
mouse is clciked outside the Parent Dialog the child window has to be closed
and the parent dialog has to minimized to the taskbar please let me know how
to handle this situation
                     Thanks and Regards
                              sures h


0
10/21/2004 10:30:53 AM
vc.mfc 33608 articles. 0 followers. Follow

3 Replies
640 Views

Similar Articles

[PageSpeed] 25

Are you referring to a dialogs that have Parent/Child relation? The reason I 
ask is because this is rather unusual. 

Modeless dialogs are used as children of the frame window as form view.
Are you writing something similar to this?


"Suresh" wrote:

> Hai
>   I Have a Parent Dialog and a ChildDialog associated with that and when the
> mouse is clciked outside the Parent Dialog the child window has to be closed
> and the parent dialog has to minimized to the taskbar please let me know how
> to handle this situation
>                      Thanks and Regards
>                               sures h
> 
> 
> 
0
RainMan1 (36)
10/21/2004 4:59:01 PM
Hai
  Actually iam not refereing to FrameWindow but iam refereing to the Dialog
Based Application with a Child Dialog and its just like the Yahoo Messanger
Smileys Button  where in if we click onto the smiley button a Child
Dialog(with list of bmps) will appear and if we click in the desktop/any
other part  the Child Dialog will disappear and what i need is when the
mouse is clicked in the desktop the parent dialog show come into the taskbar
making the child window hidden or is there any other way of doing that and
any other ideas are helpful
                     Waiting for your reply
                                           Thanks and Regards
                                                    suresh
"RainMan" <RainMan@ProximaCentauri.com> wrote in message
news:CA61E7AC-D07B-4C2D-8627-900EBB7C31BF@microsoft.com...
> Are you referring to a dialogs that have Parent/Child relation? The reason
I
> ask is because this is rather unusual.
>
> Modeless dialogs are used as children of the frame window as form view.
> Are you writing something similar to this?
>
>
> "Suresh" wrote:
>
> > Hai
> >   I Have a Parent Dialog and a ChildDialog associated with that and when
the
> > mouse is clciked outside the Parent Dialog the child window has to be
closed
> > and the parent dialog has to minimized to the taskbar please let me know
how
> > to handle this situation
> >                      Thanks and Regards
> >                               sures h
> >
> >
> >


0
10/26/2004 7:24:11 AM
I know you are not referring to a frame window. I gave it as an example of 
the scenario where modeless dialog is used as child.

You are freely referring to a dialog as child, but in reality it is not a 
child dialog. It may be owned by the window that spawned this dialog. Child 
window has WS_CHILD style and is always confined to a client area of the 
parent window. It does not matter is this window is a frame window or any 
other class.

You are referring to a popup window that is not necessarily of the CDialog 
class.

Anyway, to meet your requirement call SetCapture in you popup dialog in 
OnInitDialog.
Insert a handler for any mouse click that you want this dialog to be 
dismissed.

In a handler call EndDialog (for modal dialog) or DestroyWindow for modeless 
dialog.

You do not have to call Release capture since window is being destroyed.


"Suresh" wrote:

> Hai
>   Actually iam not refereing to FrameWindow but iam refereing to the Dialog
> Based Application with a Child Dialog and its just like the Yahoo Messanger
> Smileys Button  where in if we click onto the smiley button a Child
> Dialog(with list of bmps) will appear and if we click in the desktop/any
> other part  the Child Dialog will disappear and what i need is when the
> mouse is clicked in the desktop the parent dialog show come into the taskbar
> making the child window hidden or is there any other way of doing that and
> any other ideas are helpful
>                      Waiting for your reply
>                                            Thanks and Regards
>                                                     suresh
> "RainMan" <RainMan@ProximaCentauri.com> wrote in message
> news:CA61E7AC-D07B-4C2D-8627-900EBB7C31BF@microsoft.com...
> > Are you referring to a dialogs that have Parent/Child relation? The reason
> I
> > ask is because this is rather unusual.
> >
> > Modeless dialogs are used as children of the frame window as form view.
> > Are you writing something similar to this?
> >
> >
> > "Suresh" wrote:
> >
> > > Hai
> > >   I Have a Parent Dialog and a ChildDialog associated with that and when
> the
> > > mouse is clciked outside the Parent Dialog the child window has to be
> closed
> > > and the parent dialog has to minimized to the taskbar please let me know
> how
> > > to handle this situation
> > >                      Thanks and Regards
> > >                               sures h
> > >
> > >
> > >
> 
> 
> 
0
RainMan1 (36)
10/26/2004 4:35:04 PM
Reply:

Similar Artilces:

Removing Buttons
I copied buttons from a WEB page into an EXCEL spreadsheet. I tried to remove the buttons using edit/go to/special/objects -- but it says 'no objects found'. I also tried to 'right click' the button and cut - but it did not work either. I can send you a sample if possible. If there's no shapes you want to keep, maybe this'll do it for you. (Save your file first--just in case.) Option Explicit Sub testme() Dim iCtr As Long Dim myErrNumber As Long With ActiveSheet .Shapes.SelectAll On Error Resume Next Selection.Delete ...

Excel macro or command button to search using a user form
I have a user form which shows info about each student. I want to be able to enter a student's name in a textbox and have all the fields on the form populated with the student information. You need to be a lot more specific on what you are wanting else we have to make a lot of assumptions. I would recommend using a combobox instead of a textbox. This way you can utilize the Change Event and have the students info. automatically filled in the rest of your userform. I will assume you have a list of students in Sheet1 in Col. A. Just set the RowSource property of the c...

Closing a child Dialog when the Mouse button is clicked outside the Parent Dialog
Hai I Have a Parent Dialog and a ChildDialog associated with that and when the mouse is clciked outside the Parent Dialog the child window has to be closed and the parent dialog has to minimized to the taskbar please let me know how to handle this situation Thanks and Regards sures h Are you referring to a dialogs that have Parent/Child relation? The reason I ask is because this is rather unusual. Modeless dialogs are used as children of the frame window as form view. Are you writing something similar to this? "Suresh" wrot...

Programmatically Close Report
Hi. I have a report that, when opened with OpenArgs, prints the number of copies specified in OpenArgs. Shown here: Private Sub Report_Activate() If Len(Report.OpenArgs) > 0 Then DoCmd.PrintOut acPrintAll, , , acHigh, Report.OpenArgs End If End Sub I'm trying to programmatically close the report if OpenArgs exist. But no mater which method I try (Load, Current, Deactivate, etc), I'm getting the error "Run-time error '2585'. This action can't be carried out while processing a form or report event." Private Sub Report_Deactivate() If L...

Exit application (SDI) while Dialog or MessageBox is shown?
My SDI application have a tray icon with context menu with command Exit (ID_APP_EXIT) When I show any Dialog or Message Box (Modal) the application have no way to be closed (because MainFrm is disabled) except from Tray Context Menu. But when I exit that way the application crash because context in which dialog is shown (and wait to me closed) is destroyed :( What I can do to exit application correctly :( ? >My SDI application have a tray icon with context menu with command >Exit (ID_APP_EXIT) > >When I show any Dialog or Message Box (Modal) the application have no >way to b...

Disable 'Macro' dialog box...
Thanks Geoff, for the info on how to protect the VBA code. Have one further question; Now that the workbook and code is protected, I have sub routines that are run from command buttons. However, it is still possible to push ALT-F8 to list my routines, then click on a routine, then choose 'Run'... Is there a way to disable this option, so that users can not view or run the list of available routines (I need them to run the routines, only from the command buttons). Ruskin You can do what you want by making each macro a Private macro. This will preclude that macro from appearing...

Is there an option in Outlook '03 to confirm before closing?
Many times I will inadvertantly X out of Outlook and will have synch issues when I restart immediately. Is there an option that asks "Are you sure you want to close Outlook?" I know there is an option that asks to confirm before permanently deleting messages, but I haven't found one that will allow you to abort closing Outlook. Any ideas? "Cashman" <Cashman@discussions.microsoft.com> wrote in message news:FF1544E7-0D2F-4BC8-8BC0-FEA9EC40FEA5@microsoft.com... > Many times I will inadvertantly X out of Outlook and will have synch issues > when ...

Missing "Save Embedded Files dialog box"
I am using Frontpage 2003 (portable). After replacing my harddrive and reinstalling Frontpage 2003 I am unable to upload pictures to my website. The "Save Embedded Files dialog box" is missing and does not come up after adding a new picture to a page and saving. Suggestions? Import your images into FP web/site first (into folder of your choice), then place them into your design...you will never have a problem doing it this way. -- ~~~~~~~~~~~~~~~~~~ Rob Giordano Microsoft MVP Expression Web "USKDMMA" <USKDMMA@discussions.micro...

Dialog statusbar
I have a dialog form that I added a statusbar with five panes. Now, I created it specifically for a certain size form and when I resize the form, the statusbar is no longer the way I designed it. Is there a way to create the statusbar based on the form's size? I tried using rect.width()/5 but it did not really seem to do anything. Roger I always advocate using SDI application with CFormView derived view instead dialog based application. It looks like a dialog based application but all goodies like handling commands and resizing control bars is for free, since framework takes c...

Strange tabbed dialog message pump issue
I am running into a nasty issue that I don't quite understand. My application has a tabbed dialog type control (Stingray Tab-Wnd control) contained in a CFormView object. Within some of the tabs are CDialog-derived windows containing a grid control. I initialize all tab windows when the form view opens. The grid control also has an OnInitialUpdate method that gets called. When a tab is clicked, if it's the first time, a call is made to the tab to fill the grid. After the CFormView initialization is complete I active the first tab programatically and it fills it's gri...

Charts appear snowy (e.g., tv) unless clicked on. Memory issue?
Working with a very large workbook, and charts on the page appear snowy (like a tv on the wrong channel). When I click on the chart however, the snow disappears and the chart becomes visible. Is this a memory issue? Any quick fixes? Thanks Hi, If your chartobject appears as a gray box until selected then try then menu Tools > Options. On the View Tab make sure Show All in the Objects section is selected. Cheers Andy Vlookup help wrote: > Working with a very large workbook, and charts on the page appear snowy (like > a tv on the wrong channel). When I click on the chart ...

Outlook should keep files in the clipboard after closing a window
When you open a message (in a new window), and copy one or more files contained in this message, and then close the window, the file is not kept in the clipboard. I have to copy the file and paste it before closing the window. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the...

file dialog #2
When I open a file dialog, it always defaults to My Documents. Is there a mthod of API call that I can use to make a file dialog default to the application's working directory, or some other specified directory? Thanks. >When I open a file dialog, it always defaults to My Documents. Is there a >mthod of API call that I can use to make a file dialog default to the >application's working directory, or some other specified directory? Yes, you can alter the initial directory. The rules are explained in the description of the lpstrInitialDir member of the OPENFILENAME struct...

How to add button for macro in Fluent UI?
I have a macro in my personal.xlsb which will be available for all the workbooks in my PC. I want to add a button in the fluent UI for that macro which will be available for all the work books. How to add a custom button? If you want to learn about modifying the ribbon, you can start at Ron de Bruin's site: http://www.rondebruin.nl/ribbon.htm http://www.rondebruin.nl/qat.htm -- For macros for all workbooks (saved as an addin) or http://www.rondebruin.nl/2007addin.htm Yajiv wrote: > > I have a macro in my personal.xlsb which will be available for all the > workbooks in my PC. &...

Delay when 'send' clicked on new emails.
And replys and forwards too... Exchange 2003 with SP 1 and post fixes installs. Outlook 2003 with sp1 installed. SBS 2003 standard. Cached exchange mode enabled. When sending email from a computer on the domain at one of our clients, depending on the size of the message when [send] is clicked on the new mail message (with about 4 lines of text), the button is held down for 2 or so seconds before the windows dissapears. The computer is on a gigabit connection to the server. I turned the gigabit off and forced 100Mb connection. The delay went from 2 seconds to 25 seconds. So.. what could i...

Print form without command button.
I need to know how to print a from without the command buttons showing. Thx for your insight. On Mon, 29 Oct 2007 14:59:03 -0700, Sokan33 wrote: > I need to know how to print a from without the command buttons showing. Thx > for your insight. Set the button's Display When property to Screen Only. It's on the button's property sheet's Format tab. Note: Form's are designed for data entry, manipulation , and display, not for printing. You would be well advised to create a report with the data you wish to show. If you wish to display the data within the form'...

In Pup2003, why can't i right click on text? I use to be able to
In Pup2003, why can't i right click on text? I use to be able to. I can in any other program. HELP Did you try selecting the text box? -- JoAnn Paules MVP Microsoft [Publisher] ~~~~~ How to ask a question http://support.microsoft.com/KB/555375 "mt12" <mt12@discussions.microsoft.com> wrote in message news:4A3AC76B-27B7-4E77-9CDB-308A5EF5257F@microsoft.com... > In Pup2003, why can't i right click on text? I use to be able to. I can in > any other program. HELP ...

I can't select non adjacent cells using the control button
For some reason I am having a terrible time selecting or highlighting a group of cells and then using the control button and selecting another group of cells Are you selecting say A1:A3 then hold CTRL key and select D1:D3? What occurs when you try? How about hitting SHIFT + F8 then selecting A1:A3 and D1:D3? Gord Dibben MS Excel MVP On Sat, 19 Sep 2009 15:24:01 -0700, mustbesimple <mustbesimple@discussions.microsoft.com> wrote: >For some reason I am having a terrible time selecting or highlighting a group >of cells and then using the control button and selecting anothe...

Outlook sends mail on closing program
On closing Outlook 2002 it attempts to send e-mails. I've tried Norton and McAffee to no avail. Does not pick up any virusses. Any ideas what it may be? Please!! outlook, options, mail setup / send receive, see if there is a check mark on the performa an automatic send/receive on exit "Chris" <anonymous@discussions.microsoft.com> wrote in message news:475701c3ff5c$5858e200$a301280a@phx.gbl... > On closing Outlook 2002 it attempts to send e-mails. I've > tried Norton and McAffee to no avail. Does not pick up any > virusses. Any ideas what it may be? Please!...

folder dialog box
hi; i am learning mfc and i want to make gui application that user selects a directory and app writes all the file names in this directory to a file recursively. i am not sure where to start can anybody help me where should i start? thanks;) Have a look at BrowseForFolder()" API and 'CFileFind' class members. Have a look at http://www.codeproject.com/cpp/BrowseForFolder.asp for help with some sample code. -Seetharam Seetharam wrote: > Have a look at BrowseForFolder()" API and 'CFileFind' class members. That's SHBrowseForFolder(). -- David Wilkinson ...

Close button on tabs
I have a tab control with icons + labels. I want to include a little 'x' on the top-right corner of each tab (a close button). I suspect I'm going to need to create a custom control. My question is: Is is possible to subclass or somehow utilize CTabCtrl so that I don't have to recreate the entire control form a CWnd or CStatic control? If so, how? Thank you all. You can owner-draw the CTabCtrl. Here is a sample. http://www.codeguru.com/Cpp/controls/controls/tabcontrols/article.php/c2237 You could draw the "X" in the DrawItem() code. -SM On Sep 9, 2:56=A0am, Se...

Voting Buttons
Hello, I have an approval process that I an trying to make faster. I would like to send the necessary files to the required reviewers, and include voting buttons for them to 'accept' or 'reject' the data. I learned how to set up a template for this purpose and have successfully seen the vote responses recorded in the original e-mail on the "tracking" tab. I can print this e-mail once all have responded and have a paper record of their votes. However, there are times when the voters "edit their response before sending" and include comments. Rathe...

Child windows that keep same relative size
/* I am trying to make a window with a bunch of child windows that resize themselves so that they always take up the same proportion of the client window...sort of like something that java does?? I have one button in my window, and it behaves ok, but before I start adding a bunch of other child windows, could you kind folks please look at my code and give me some software design guidance so I minimize code duplication. ....any hints good!! thanks */ // Main.cpp #include "CMyWinApp.h" CMyWinApp MyApplication; // CMyWinApp.h #include <afxwin.h> class CMyWinApp : public CWi...

Displaying Dialogs in Views
I've got several dialogs that I'd like to have up all the time and allow the user to, say, drag the mouse across items in one view and have their definition show up in the other view. At the moment I've got a dialog that comes up by doing a right click that displays the definition, but it takes over the mouse and you have to clear the dialog before you can get back to the main view. Since the Dialog works fine and is in the format I want, is there any easy way to create a new view, on the other side of the splitter bar and just plug that dialog in? I realize I'd need to have so...

Insert | File > Attachmnet-Button Drop Down ;What is the difference between Insert and Insert As Attachmnet
re: "Outlook2003, File-Insert-Options" On making new-email with Attachment-File(s), ** File Menu | Insert | File >>> (Brows and select File to insert ) then we can see the button "Insert", and write side Drop Down Arrow lower-right side of Dialog Box; If it clicked, we can see three options as follows: ** Insert Insert as text Insert as Attachment I can not recognize/understand the difference between "Insert" and "Insert as Attachment" *** What is the difference between Insert and Insert As Attachment ? I would appreciate y...