X button in the Dialog MFC vc++
-
I trying to put some custom functionality when x button is clicked for a specific dialog. There is no cancel button in this dialog. What would be the best way to do this? Thank you.
-
I trying to put some custom functionality when x button is clicked for a specific dialog. There is no cancel button in this dialog. What would be the best way to do this? Thank you.
Have a look at [visual studio - Close Button on Title Bar in MFC - Stack Overflow](https://stackoverflow.com/questions/1163484/close-button-on-title-bar-in-mfc)
-
I trying to put some custom functionality when x button is clicked for a specific dialog. There is no cancel button in this dialog. What would be the best way to do this? Thank you.
Can you handle the WM_CLOSE message ?
I'd rather be phishing!
-
I trying to put some custom functionality when x button is clicked for a specific dialog. There is no cancel button in this dialog. What would be the best way to do this? Thank you.
Override the dialog's
OnCancel()
method."One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
-
Have a look at [visual studio - Close Button on Title Bar in MFC - Stack Overflow](https://stackoverflow.com/questions/1163484/close-button-on-title-bar-in-mfc)
Thanks, this is exactly what I wanted. :)
-
Thanks, this is exactly what I wanted. :)
While
OnClose()
does get called when dismissing the dialog using the X or Alt+F4, it will not get called when dismissing the dialog using Esc or clicking the Cancel button (if one is present). This may not be an issue for your specific dialog, however."One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles