0

How to associate custom windows forms app to particular URL, e.g. myprogram:?xt=myparams

<a href="myprogram:?xt=myparams">Open my program</a>

whenever user clicks on the links from any browser it opens up myprogram windows app passing the parameters in querystring(?)

Is it possible to associate windows app with a URL in browser without installing any plugins in browser?

Nitin Sawant
  • 7,278
  • 9
  • 52
  • 98

1 Answers1

0

You can setup a custom protocol in Windows and associate it with your program. You have to do this via the Windows registry. Either manually, with a .reg-file or with some kind of installer program which creates the entry for each end user.

Details about this are already answered here How do I register a custom URL protocol in Windows?

Having that registry entry should affect all browsers and will make them open your program whenever a link is using your custom protocol.

Also note that the full URL will be passed to your program as a command line argument. You have to parse that string manually. I assume you're using C# because you used it as a tag. The .NET framework provides methods for parsing URLs and getting the parameters Get URL parameters from a string in .NET