Archived

This topic is now archived and is closed to further replies.

Preventing dialogs being closed by ESC

This topic is 5235 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Intercept the WM_CLOSE message and return 0, the add a custom button with a non-general ID and allow that to close the dialog. Or you could do some extra testing in the WM_CLOSE handler to see if it was esc that was pressed and forces the dialog to close.

Share this post


Link to post
Share on other sites
If you''re using MFC, try overriding the virtual OnCancel() member function of CDialog.

--------------------


You are not a real programmer until you end all your sentences with semicolons; (c) 2000 ROAD Programming

You are unique. Just like everybody else.

"Mechanical engineers design weapons; civil engineers design targets."
"Sensitivity is adjustable, so you can set it to detect elephants and other small creatures." -- Product Description for a vibration sensor

Yanroy@usa.com

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
One fast way is to make a IDCANCEL button that is hidden and disabled on your dialog.

Share this post


Link to post
Share on other sites