Equivalent to AppleEvent under Windows and Linux

I’m using the HandleAppleEvent event under macOS to receive mailto: requests into my app when f’rinstance a user clicks on a mailto: link in a browser. Are there equivalent mechanisms I can use for Windows and Linux?

You need to define/update a mime type for the mailto: URI. For some, it’s probably already defined and just needs to be updated to call your app instead of Mail, Thunderbird, Outlook, etc.

This blog post might help:

https://blog.xojo.com/2016/08/16/custom-uri-schemes-on-windows/

Thanks for that. I’ve seen the macOS version of that blog post and have incorporated the part about Getting the Data into my HandleAppleEvent event handler, which duly picks it up. But I don’t have the first part, relating to the registration build step, in my app, and yet if I click on a mailto: link in Safari, my app picks it up. Would this be because I told Apple’s Mail to make my app the default mailer on this machine? If so, and as mailto is a standard rather than a custom URI, do I need to register it under Windows as described in the blog you linked? And how does my app receive the notification - it’s already running.

About the default mailer - Very likely as you’ve told mail that any time it would normally be invoked to handle a mailto URI your application should be used instead.

About registering it under Windows - Very likely as if you don’t then some other application may get invoked when a mailto link is clicked on.

On receiving the notification - That will vary between macOS and Windows. On macOS you likely get an AppleEvent to handle the uri - as you already stated.
On Windows it can vary (see the MSDN article) as to whether it’s run a second time or not. Usually it is with extra command line arguments.

Well this is a mystery. My project is stored as a xojo_project (i.e., not binary). And along with all the project items I see a file called mailtoRegistrationScript.xojo_code. But I can’t see this script anywhere in my project in the IDE. Where should it show up?

A script is probably a build step, expand all your targets.

That’s what I would have thought too, but none of my targets is showing a build step at the minute.

You can check the .xojo_project in a text editor to see if it’s referenced at all.