ESC character closes dialog box in MFC Appl 
Author Message
 ESC character closes dialog box in MFC Appl

Hi,

Does anyone know how I can force my MFC dialog-based application not to
be closed when a user press ESC key? That's ver inconveniant!

Thanks in advance,

--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=



Wed, 23 Jul 2003 18:39:08 GMT  
 ESC character closes dialog box in MFC Appl
Greets,

    Override PreTranslateMessage() and watch for a WM_KEYDOWN where the key
code is VK_ESCAPE.  Don't let it through.  :)

Regards,

Joe


Quote:
> Hi,

> Does anyone know how I can force my MFC dialog-based application not to
> be closed when a user press ESC key? That's ver inconveniant!

> Thanks in advance,

> --
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=



Wed, 23 Jul 2003 21:06:31 GMT  
 ESC character closes dialog box in MFC Appl
Override the OnCancel() function and don't call CDialog::OnCancel() in the
body.

Marc.



Quote:
> Hi,

> Does anyone know how I can force my MFC dialog-based application not to
> be closed when a user press ESC key? That's ver inconveniant!

> Thanks in advance,

> --
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=



Wed, 23 Jul 2003 23:48:42 GMT  
 ESC character closes dialog box in MFC Appl
FYI--that is the proper behavior for an application.

--
Reginald Blue                   | Opinions expressed here do not
Natural Language Understanding  | necessarily represent those of
Unisys Corporation              | my employer.
--------------------------------+-------------------------------

NL technology,speech application| My email address is wrong, you
development training, see:      | need to remove the obvious.
http://www.speechdepot.com/     +-------------------------------


Quote:
> Hi,

> Does anyone know how I can force my MFC dialog-based application not to
> be closed when a user press ESC key? That's ver inconveniant!



Fri, 25 Jul 2003 23:45:49 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. PBM: Message box not displayed after main dialog box is closed in MFC dialog-based app

2. Click Esc key to close the modeless dialog box

3. Mfc dialog-based app: dont close on esc or enter

4. Preventing dialog from closing on ENTER and ESC

5. close dialog with Esc

6. Need code to prevent ESC from closing dialog

7. Prevent closing dialog application on Enter & Esc

8. Disable ESC Key in a Dialog Box under VC++

9. Pressing RETURN or ESC key on a Dialog Box

10. Disabling Esc key for a dialog box

11. Esc in dialog box

12. Overriding Enter and Esc. in dialog box

 

 
Powered by phpBB® Forum Software