Of note, the signal handler function must be a global method; I tried to make it a method on the Application class, but that would crash in RuntimeUnlockObject.
And those examples don’t seem to be for Windows, too…
So while I can get this working for macOS/Linux, I’m still looking for a way to detect this (e.g. pressing “Ctrl + C”) on TargetWindows so that I can do some cleanup before the Xojo console/service app is being quit…
It does
Thanks a lot for your example project for TargetWindows…!
How about adding this example to <https://xojo.com/issue/2332>?
Then there would be example for all Targets… both for Devs looking for a solution now, and for Xojo to implement this via their Framework.