Custom Protocol Links
We can create custom protocol links that can carry out operations as per the configurations
For example: <a href="mailto:as@b.c">
Similar to the mailto protocol we can create our own protocol. In my case I created one that would launch an application when this link is clicked. I had to start a project in my solution based on certain conditions. So I created this custom protocol that would start the project based on the requirements.
Create an entry in the registry as follows
Add a new string value to the command folder with the path to the .exe file that needs to be launched
ex: "C:\mine\sample.exe" "%1". The %1 denotes that we will be passing parameters to the main method . The parameters will be received inside the string[] args in the main Method of the program.
Creating a custom MIME TYPE
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.msg]
@="msg_file"
[HKEY_CLASSES_ROOT\msg_file]
@="MSG"
[HKEY_CLASSES_ROOT\msg_file\shell]
[HKEY_CLASSES_ROOT\msg_file\shell\open]
[HKEY_CLASSES_ROOT\msg_file\shell\open\command]
@="\"C:\\AtomHandler\\handle.exe\" %1"
[HKEY_CLASSES_ROOT\MIME\Database\Content Type\application/msg]
"Extension"=".msg"
Save it with .reg extension
accept="application/msg"
https://docs.plesk.com/en-US/onyx/reseller-guide/website-management/websites-and-domains/extended-website-management/using-virtual-directories-windows/adding-and-removing-mime-types.65216/
https://stackoverflow.com/questions/1201945/how-is-mime-type-of-an-uploaded-file-determined-by-browser
accept="application/msg"
https://docs.plesk.com/en-US/onyx/reseller-guide/website-management/websites-and-domains/extended-website-management/using-virtual-directories-windows/adding-and-removing-mime-types.65216/
https://stackoverflow.com/questions/1201945/how-is-mime-type-of-an-uploaded-file-determined-by-browser
Comments
Post a Comment