Click to See Complete Forum and Search --> : Esc Key, not always close the dialog...


Braulio
April 30th, 1999, 09:37 AM
Hi,

I have a dialog and I want that before close one window with the "Esc" Key, ask to save some datas, and if the save operation fails, not to close the window.

Is there an easy way to do this ?, I have thinked about in pretranslate message get the message for ESC_KEY ( what message is ?), and then ask, and if it fails, get out the message.

Anybody can help me ? Thanks, Bye !
Braulio

April 30th, 1999, 09:56 AM
If you have IDCANCEL button in your dialog then just add event handler BTN_CLICKED for that control.

And if you don't just add member function
virtual void OnCancel();
to your dialog class.