Archived

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

Fish HF

Preventing dialogs being closed by ESC

Recommended Posts

Crispy    556
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
Yanroy    122
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   
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