核心提示:部分代码:procedure RegisterFileType(ExtName:String; AppName:String) ;var reg:TRegistry;begin reg := TReg...
部分代码:
procedure RegisterFileType(ExtName:String; AppName:String) ;
var
reg:TRegistry;
begin
reg := TRegistry.Create;
try
reg.RootKey:=HKEY_CLASSES_ROOT;
reg.OpenKey('.' + ExtName, True) ;
reg.WriteString('', ExtName + 'file') ;
reg.CloseKey;
reg.CreateKey(ExtName + 'file') ;
reg.OpenKey(ExtName + 'file\DefaultIcon', True) ;
reg.WriteString('', AppName + ',0') ;
reg.CloseKey;
reg.OpenKey(ExtName + 'file\shell\open\command', True) ;
reg.WriteString('',AppName+' "%1"') ;
reg.CloseKey;
finally
reg.Free;
end;
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, nil, nil) ;
end;
全部代码已经打包
迅雷专用高速下载