How to create a “custom protocol” and map it to the application?

How can I create a "custom protocol"? I know that you can create a URL protocol by adding a few registry entries to HKEY_CLASSES_ROOT, but it seems to work only in the browser. I need it to work in Windows Explorer.

I know that I can write a client / server interface, but I think this is too much for my clients (and budget).

In short...

  • A third-party application should call: tbwx:<row_id>
  • My application should download and delete the entry from the database.

It sounds pretty simple (or so I thought). Any ideas?

thanks

+6
c # windows protocols
source share
2 answers

At least in Windows 7, you can create your own protocol as long as you add a URL Protocol value of type REG_SZ to the key. He does not need real value, he just has to be present. Here is a simple example of the “Echo Protocol” that I just created that works in Explorer.

 Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\echo] "URL Protocol"="" @="Echo Protocol" [HKEY_CLASSES_ROOT\echo\shell] [HKEY_CLASSES_ROOT\echo\shell\open] [HKEY_CLASSES_ROOT\echo\shell\open\command] @="C:\\WINDOWS\\SYSTEM32\\CMD.EXE /Q /C (echo %1) && pause" 

I found that it will also work on the keys HKCU\Software\Classes and HKLM\Software\Classes . However, it is not listed in the Control Panel\Programs\Default Programs\Set Associations list. Other keys may need to be updated, or they will need to be registered in some way with Windows.

I believe this is the same or similar in older versions of Windows XP and above.

+9
source share

Registering the application in the URL protocol describes the process in detail. There is uilitiy on CodePlex , which can be used to register custom URL protocols. Source code is provided.

+4
source share

All Articles