I made a program which i want to launch with some protocal for eg : proto
Called like proto://122122 from the browser.
When the user clicks on the link it opens my program and sends the number ahead it as some variable or something.
I have basic knowledge of c++ but no knowledge on this topic
Thanks
You will need to add the protocol to the registry, in
HKEY_CLASSES_ROOT.In particular you need to create the following keys:
Then opening
proto://122122will executeProgram.exe, and the numbers will be available in$CmdLine[1](assuming you are using AutoIt, as you tagged it like that but don’t mention it at all).Edit:
To programatically do the above in AutoIt, you will need to look at the registry functions, in particular RegWrite. Above I was lazy and gave a
.regfile like answer, but in AutoIt it looks something like:As with all things registry, don’t do it, if you don’t know what you are doing. Modifying HKCR is relatively safe. The worst that will happen is you’ll overwrite some other protocol and it’s a bit of a pain to undo, but I still recommend doing some reading first. Google is your best friend as usual, but a small into like this one is probably a good idea.
To remove the above code just delete the entire “HKCR\proto” key.