I want to trigger an event in my running application and deliver arguments with the call of a URL scheme in Windows 10. I made the following registry entry:
HKEY_CLASSES_ROOT
alert
(Default) = "URL:Alert Protocol"
URL Protocol = ""
DefaultIcon
(Default) = "alert.exe,1"
shell
open
command
(Default) = "C:\Program Files\Alert\alert.exe" "%1"
Obviously, this always starts a new instance of my application with an argument, when calling 'alert:arg1'. But I want Windows to call my already running instance.
With Mac, the call of this URL scheme triggers an event, I can catch. Exactly, as I want. To do this, I added the following part to alert.app/Contents/Info.plist:
<array>
<dict>
<key>CFBundleURLName</key>
<string>Alert</string>
<key>CFBundleURLSchemes</key>
<array>
<string>alert</string>
</array>
</dict>
</array>
So how do I realise this on Windows? I'm programming this application in XOJO with object-oriented BASIC, but I'll be happy about a general solution.