Register new URL type with Delphi
// You could access your program like this: money://...
// But don't use money://, it is registered by Microsoft Money.
//
const
URL_TYPE = 'spec';
var
Reg: TRegistry;
Handler: String;
begin
//
Reg := TRegistry.Create;
Reg.RootKey := HKEY_CLASSES_ROOT;
try
Reg.OpenKey(URL_TYPE +'\shell\open\command', True);
Handler := ''; // your program location.
// Do Register here.
Reg.WriteString('', Handler);
Reg.CloseKey;
Reg.OpenKey(URL_TYPE, True);
Reg.WriteString('', 'url: Spec.....');
Reg.WriteInteger('EditFlags', 2);
Reg.WriteString('URL Protocol', '');
Reg.CloseKey;
finally
Reg.Free;
end;

0 条评论:
发表评论
<< 主页