procedure
Registration( FileType, FileTypeName, Description, ExecCommand,Index:
string
);
var
reg: TRegistry;
begin
if
( FileType =
''
)
or
( FileTypeName =
''
)
or
( ExecCommand =
''
)
then
Exit;
if
FileType[
1
] <>
'.'
then
FileType :=
'.'
+ FileType;
if
Description =
''
then
Description := FileTypeName;
reg := TRegistry
.
Create;
with
Reg
do
begin
RootKey := HKEY_CLASSES_ROOT;
OpenKey( FileType,
true
);
WriteString(
''
, FileTypeName );
CloseKey;
OpenKey( FileTypeName,
true
);
WriteString(
''
, Description );
CloseKey;
OpenKey( FileTypeName +
'\DefaultIcon'
,
true
);
WriteString(
''
, ExecCommand +
', '
+ Index );
CloseKey;
OpenKey( FileTypeName +
'\Shell\Open\Command'
,
true
);
WriteString(
''
, ExecCommand +
' %1'
);
reg
.
CloseKey;
end
;
reg
.
Free;
end
;