I'm writing a program which creates no forms at all until one is required. The problem is, it's preventing shutdown from continuing automatically. I've seen discussions about adding an if
to form closing events to check if it's due to shutdown, but as I've said, my program is meant to have no forms at all until required.
Is there any event or some other method that will allow me to know when my program should be closing itself to allow for Windows to shut itself down automatically? And it's not multithreaded.
You can use the SystemEvents
class, to "listen to" users logging out, or shutting down.
If I understand the documentation correctly (and a deep study with Reflector confirms this):