Solved

Modeless dialog box 'ESC key exit code'

Posted on 1997-07-14
1
317 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 20 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now