473,795 Members | 2,954 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

closing/hiding custom modeless dialogs?

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 the main window has focus).

Btw I am not using any MFC.

Anyone knows the solution to this problem?
Any help is greatly appreciated!

Rikkert

(PS: could it have something to do with the WS_EX_NOPARENTN OTIFY style
set when using dialog box templates?)
Jul 22 '05 #1
3 3421
Rikkert wrote:
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. [snip]
Rikkert

(PS: could it have something to do with the WS_EX_NOPARENTN OTIFY style
set when using dialog box templates?)


It has nothing to do with WS_EX_NOPARENTN OTIFY, but it has all
to do with asking in the proper newsgroup. Try a microsoft
newsgroup (many are listed in the Welcome.txt below).

This newsgroup, news:comp.lang. c++, discusses the _standard_ C++
language which has no facilities for windows nor dialog boxes.
Please read the FAQ below.

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.l earn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book

Jul 22 '05 #2
r_****@hotmail. com (Rikkert) wrote in message news:<27******* *************** ****@posting.go ogle.com>...
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 the main window has focus).

Btw I am not using any MFC.

Anyone knows the solution to this problem?
Any help is greatly appreciated!

Rikkert

(PS: could it have something to do with the WS_EX_NOPARENTN OTIFY style
set when using dialog box templates?)


The following make no sense in Standard C++:
custom-made modeless dialog box
Visual C++.net Win32
clicking
close button
pressing Alt-F4
IsDialogMessage
dialog
dialog procedure
WM_DESTROY message
close my application
dialog has focus
main window
child
MFC

(This list is not meant to be exhaustive)

So your post makes no sense in the context of Standard C++.

-- --
Abstraction is selective ignorance.
-Andrew Koenig
-- --
Jul 22 '05 #3
sorry about that guys.. I am new to this ;-)
Jul 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1620
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
3192
by: Andrew | last post by:
I get a Null Reference Exception if I close a modeless form (that is, a form displayed using Show()) when a selection is made from a ComboxBox. If the form is modal (displayed using ShowDialog()) or the selection is made from, say, a ListBox, no exception is thrown. I have included a simple example below. The error message refers to Unsafe Native Methods, but the code is 100% managed. What is going on ? I am using C#.NET 2003, Standard...
6
3230
by: Gary Miller | last post by:
Does anyone know how to detect a modeless form on closing by the form that invoked the modeless form? form.Show();
3
13510
by: boney.dalwani | last post by:
Hello All, I m new to JavaScript and widely Exploring programming in js i have a situation where in i do not want to use alert(message); / prompt(message) kind of functionility. rather i want to contruct a custom dailog Box. Is it possible to construct a custom dailog Box using javascript ? if yes, can anybody guide me through the mechanism ....
0
1911
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...
14
3367
by: =?Utf-8?B?UHVjY2E=?= | last post by:
Hi, I'm using VS2005 and .net 2.0. I'm creating an application that has 3 forms. I want allow users to move forward and backward with the forms and retain the data users have entered. I thought I'll make the inactive forms invisible but this is creating a memory corruption problem when user close the form2 or form3 and not the formMain. My main form has a Next button which makes the main form invisible and starts a new form which I'll...
19
4651
by: rbrowning1958 | last post by:
Hello, I am confused by dispose etc. and hope someone can set me right. 1. The Dispose(Bool) the IDE generates for a form has nothing to do with IDisposable, right? 2. So when is this called? When a form is closed? If this is caused automatically when a form is closed how can I then access things on a modal from after ShowDialog() returns? Or is it only for modeless forms?
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...
1
3520
by: dshin | last post by:
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...
0
9673
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
9522
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10217
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...
0
10003
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
9046
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...
0
6784
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();...
0
5440
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5566
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4114
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.