473,804 Members | 4,288 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

custom exit of MFC modeless dialogs

5 New Member
I created a dialog-based MFC application. The initial dialog has a button, which when pressed, constructs and displays a new modeless dialog. When I click the top-right "X" on this modeless dialog, I wish to do some custom-clean-up. I cannot figure out how to do this.

I believe the right way to do it is to override the virtual function PostNcDestroy() , and to somehow intercept the event corresponding to the click of the "X" and dispatch to DestroyWindow() . But I can't figure out how to intercept that event.
Dec 9 '08 #1
1 3520
dshin
5 New Member
Never mind, figured it out: just needed to override OnCancel().
Dec 9 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1858
by: Alex | last post by:
I am trying to write an Exit module for the Certification server in VB.NET and I cant get the module to be recognised by the Certification MMC snap in. Its function is to capture Serial Numbers of newly created certificates. This is quite obscure and I cant really find any example code. On the face of it it looks pretty straightforward. I have created a Class Library and created a class called Exit as this is suggested for VB, tho I...
3
3422
by: Rikkert | last post by:
I can't get my custom-made modeless dialog box (Visual C++.net Win32) to respond to clicking the close button or pressing Alt-F4. I am using the IsDialogMessage to check if messages are for my dialog. However, my dialog procedure doesn't seem to get a WM_DESTROY message when I click the close button. Also, pressing Alt-F4 does not close my application when the dialog has focus (it does terminate when my main window or another child of...
8
9101
by: vince | last post by:
I have a windows app whose main dialog contains a button that launches a form. I've tried using Form.Show() to have it launch as a modeless form, but it behaves as if it's modal (i.e. parent form can't receive focus)... Can someone tell me what I need to do to make the child form modeless..??? I want to be able to alternate focus between both dialogs... thanks,
0
1263
by: M | last post by:
Hi, I got a C# project which uses a "CORE" originally written in SDK. If I triger an event which bring up a Modeless dialog created using either old SDK C++ code or MFC/C++ code, the cursor keys don't work properly. If you use the cursor keys, the modeless dialog losses focus to the Parent Form. Anyone got any ideas of how fix this problem? Cheers,
2
1576
by: john doe | last post by:
I have the following code: private void LaunchForm() { Form1 form1 = new Form1(); form1.Show(); } My question is, where does form1 "go" once the method has exited? Specifically, I'm interested in not having to put try/catch blocks
0
1057
by: JR | last post by:
I am opening a html page using showModalDialog. To the page's onError event, i am attaching custom event handler. When ever any exception occures, onError event is firing 2 times. I found the same issue with modeless dialogs aswell. Is this a bug with IE? How can i make onError event to fire once? please help.
0
1912
by: Sin Jeong-hun | last post by:
I've found that if a MessageBox (called by alert/confirm from Javascript) or a web page modeless dialog is popped up, I cannot call Navigate of the WebBrowser control. If I do, a COM exception occures. How can I disable javascript MessageBoxes or modeless dialogs? I disabled normal popup windows by adding e.Cancel=true at the browsers newwindow event. But I couldn't disable modeless dialog or javascript MessageBox. I tried to remove some...
1
1218
by: ahmed | last post by:
Guys, I want to add to custom dialogs to my setup project. Unfortunately, I need only two radio buttons on each dialog. The wizard allows me to add a custom dialog with two radio buttons only once!!!!! Is there any work around this issue?
3
5169
by: DoB | last post by:
What is the preferred way to refresh modeless dialogs? I am using the modeless dialog that shows a progress of a sequential process. The dialog class has nonvisual properties containg the progress status data and the dialog window has a timer and refreshes on every tick, but it does not seem to work correctly. Maybe I am doing it all wrong... what is a suggested way of programing this, provided that I want to have one general dialog...
0
9710
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10593
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10340
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10329
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10085
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9163
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7626
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6858
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4304
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.