Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Modeless dialog box 'ESC key exit code'

Posted on 1997-07-14
1
Medium Priority
?
327 Views
Last Modified: 2013-12-03
Hi , still a question with my damned modeless dialog box :).

When i execute from my CmainFrame a modeless dialog box (you know tihtou using DoModel , using Create instead to run it), i didn't found in the classwizard how to disable the ESCAPE key . If the user press ESCAPE in the Modelles dialog box , i dunno how to make the window still visible , and what code is send to the dialog box or to the Main frame window (MDI apI) thanx for da answer ..
0
Comment
Question by:SkizoWalker
1 Comment
 
LVL 23

Accepted Solution

by:
chensu earned 60 total points
ID: 1400906
Pressing ESC is the same as clicking the Cancel button in a modal or modeless dialog box. You can override CDialog::OnCancel() function.


CDialog::OnCancel

virtual void OnCancel( );
 
Remarks
The framework calls this member function when the user clicks the Cancel button or presses the ESC key in a modal or modeless dialog box.
Override this member function to perform Cancel button action. The default simply terminates a modal dialog box by calling EndDialog and causing DoModal to return IDCANCEL.
If you implement the Cancel button in a modeless dialog box, you must override the OnCancel member function and call DestroyWindow from within it. Don’t call the base-class member function, because it calls EndDialog, which will make the dialog box invisible but not destroy it.


0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question