How do you create your own moniker (URL Protocol) on Windows systems?
procedure InstallIntoRegistry;
var
Reg: TRegistry;
begin
Reg := TRegistry.Create;
try
Reg.RootKey := HKEY_CLASSES_ROOT;
if Reg.OpenKey("moniker", True) then
begin
Reg.WriteString("", "URL:Name of moniker");
Reg.WriteString("URL Protocol", "");
Reg.WriteString("Source Filter", "{E436EBB6-524F-11CE-9F53-0020AF0BA770}");
Reg.WriteInteger("EditFlags", 2);
if Reg.OpenKey("shellopencommand", True) then
begin
Reg.WriteString("", """ + ParamStr(0) + "" "%1"");
end;
end else begin
MessageBox(0, "You do not have the necessary access rights to complete this installation!" + Chr(13) +
"Please make sure you are logged in with a user account with administrative rights!", "Access denied", 0);
Exit;
end;
finally
FreeAndNil(Reg);
end;
MessageBox(0, "Application WebStart has been installed successfully!", "Installed", 0);
end;
Source: By Brett Veenstra as answer to the question
This code snippet was collected from stackoverflow, and is licensed under CC BY-SA 2.5
Related code-snippets:
- Is gettimeofday() guaranteed to be of microsecond resolution?
- Embedding Windows Media Player for all browsers. Will help in making it portable.
- Register Windows program with mailto protocol programmatically.
- How do I see preview JPEG file of PDF on Windows?
- What are the best ways to access Exchange using PHP?
- Visual Studio Setup Project - Per User Registry Settings.
- What is the best file copy alternative than the Windows defaults?
- What does wiggling the mouse do?
- How can I retrieve a windows filename?
- How do I install Debian in Windows?
- Windows Equivalent of 'nice'.
- Registry vs. INI file for storing user configurable application settings. In Linux, registry vs. INI file for storing user configurable applications settings.
- How can I redirect stderr from calls to fprintf?
- How do I wrap RSYNC for Windows?
- What are the top domains in a network?