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.
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.
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.