I have an MFC application, which i don't want to be closed during the running. I have disabled the "X" icon in the right upper corner, but now if i press the ESC key, or ALT+F4 it still closes.
How can i disable this, so it won't close, if someone press those keys? After the program has finished running i want to reenable them.
Thanks,
kampi
If you handle the WM_CLOSE
message and throw it away. (i.e. Don't call DefWindowProc
), then the window won't close.
You could also register the window class with the CS_NOCLOSE
style, to disable all of the normal ways of closing the window.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With