Register as an URL handler

I’m investigating how to make my application to detect and handle a custom URL (e.g: myapp://blah)
I know how to do it on Mac, changing the Info.plist and adding the CFBundleURLTypes key.
But is this possible on Windows and how?

Yes, it’s possible. I’ve done it. A quick Google search found this good starting point:

http://msdn.microsoft.com/en-us/library/aa767914(VS.85).aspx

Thank you Brad!

I got it working, but there is a problem I’m not sure how to solve.

If my application is closed it will open with the passed URL as an argument. Fine.
If it’s already open, Windows try to launch another instance of my application. But I don’t want this, and in fact I set a Mutex to prevent it.

But now how I can handle the URL in the currently running application?
I see that Xojo Feedback do this, but don’t know how.

[quote=45707:@Massimo Valle]But now how I can handle the URL in the currently running application?
I see that Xojo Feedback do this, but don’t know how.[/quote]
Use an IPCSocket to send the URL to the first opened instance.

After detecting with the Mutex that it’s the first instance, create an IPCSocket to listen to a specific Path of your own.
Now, if an instance detect that it’s not the first one with the Mutex, create an IPCSocket and use it to send, with the same Path, the data needed to the first instance, optionally with a handshake protocol to be sure the data have been received and will be processed, and then quit the second instance.

I was afraid of having to do this :frowning:
Damn Windows…