With many UPS in case of power failure there is the chance to start a script to be executed before shutting down the system.
In my Qt application I would like to detect some kind of event I can trigger from a batch script and start a procedure to safely stop my application (controlling some HW) before shutting down the host PC. Which is a clean way to make so? How can I listen for such "external" event from my application? and how can I trigger the event itself on Win10?