This part does a less-than-decent job:


void CMyProgDlg::OnCancel()

{

// do nothing

}


This will prevent the dialog box from closing due to a user pressing

the ESC key. Unfortunately, this will also prevent other methods of

exiting the dialog app, including Alt-F4 and pressing the "X" button

at the top right corner. I want the user to still be able to quit using

these methods (but not using ESC).


So, the question is : is there some way to specifically intercept

the ESC key before the IDCANCEL is issued to close the dialog box?