Can anyone help me on how to disable the close button in C programming? , or just anyway that you can't close the program manually.
Can anyone help me on how to disable the close button in C programming? , or just anyway that you can't close the program manually.
Yeah, probably XP or w7.
Like, http://img197.imageshack.us/img197/7796/3232m.png
In summary, i just want my program to be a trap, I mean, like, you can't close it by pressing the X button on the upper right hand corner, alt+f4, or what so ever.
Maybe the only way in closing is is through task manager.
Thanks.
Using WinAPI I guess. Well, there should be able to override "OnClose" event handler or signal handler or whatever the terminology is. So it doesn't do nothing when the X is pressed (the signal won't be handled).
Another way is to simply take of the bar that has X button (by making borders to 0 or the bar size to 0). But then you would have to do something about ALT+F4 as well. It is better to do both, so users know that it cannot be closed.
Anyhow, don't know exactly how, so you will have to wait for somebody else Never used WinAPI my self.
Well, I hope so, haven't tried it too. I found some codes but it is only for C#, How sad. Anyway, how do you apply making borders to 0 and the bar size?
So? No one can still help me here with this?
Disable the close button with your window styles, and also subclass all windows of your application and handle the WM_CLOSE message.
Leave a way (password perhaps) to re-enable WM_CLOSE processing if you ever want a clean termination.
How do I do that then? I'm a beginner with C. I just want a code to disable the button or what else.
I wanted to move this to the appropriate forum, but this sounds malicious, so sorry, I am closing this thread.Originally Posted by dissidia
The question would have been far more convincingly valid if you knew some GUI programming to begin with.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)