How to create an unclosable form ?

May 31, 2013 at 2:16pm
I want to create a form that you can't close. Obviously disabling the Control Box isn't going to be enough since you can still just use Alt+F4, Task Manager, etc.
I was thinking maybe detect that the window is being closed and just open another instance of it?
Don't know if that's possible, any help would be very much appreciated.
May 31, 2013 at 3:02pm
Just off the top of my head (don't know much Windows programming), but just have a second process that sits in the background and watches for the form process. Once it's gone, it invokes another instance of it and then goes back to watching.
May 31, 2013 at 3:51pm
Firstly, this is a very Windows-specific question, so you may want to ask in there instead.

I'm not the most knowledgeable person in the world about Windows GUI stuff, but presumably there's a way to catch the CLOSE events that would be triggered by any OS attempt to close the form. Then, in the event handling code, it should be possible to indicate to the calling framework (e.g. via the return code) whether or not to actually close the window.

May 31, 2013 at 4:39pm
Thank you both, I got an in-depth answer in the Windows forum.
Last edited on May 31, 2013 at 5:43pm
Topic archived. No new replies allowed.