------------ Дoбавленo:
Byuik, Попробуй заменить .pas на этот
unit hiOneCopy;
interface
uses Kol,Share,Debug,Windows;
type
THIOneCopy = class(TDebug)
private
Ident: string;
procedure XXX(ID: string);
//procedure YYY(Sender: PObj);
procedure OnAnotherEvent(const CmdLine: String);
public
_prop_Close:boolean;
_prop_Ext,
_prop_Comment,
_prop_IconName: string;
_data_IconName:THI_Event;
_data_Comment:THI_Event;
_data_Ext:THI_Event;
_event_onRun:THI_Event;
//constructor Create;
procedure _work_doRegFileType(var _Data:TData; Index:word);
property _prop_Ident: string write XXX;
end;
implementation
//constructor THIOneCopy.Create;
//begin
// Inherited Create;
// Applet.Children[0].onShow := YYY;
//end;
procedure THIOneCopy._work_doRegFileType;
var
reg:HKey;
path: string;
begin
reg:=RegKeyOpenCreate(HKEY_CLASSES_ROOT,'.' + ReadString(_Data,_data_Ext,_prop_Ext));
RegKeySetStr(reg,'',Ident);
RegKeyClose(reg);
reg:=RegKeyOpenCreate(HKEY_CLASSES_ROOT,Ident);
RegKeySetStr(reg,'',ReadString(_Data,_data_Comment,_prop_Comment));
RegKeyClose(reg);
reg:=RegKeyOpenCreate(HKEY_CLASSES_ROOT,Ident + '\DefaultIcon');
RegKeySetStr(reg,'',ReadString(_Data,_data_IconName,_prop_IconName));
RegKeyClose(reg);
reg:=RegKeyOpenCreate(HKEY_CLASSES_ROOT,Ident + '\shell\open\command');
SetLength(path,1024);
SetLength(path,GetModuleFileName(HInstance,PChar(@path[1]),1024));
RegKeySetStr(reg,'','"' + path + '"' + ' "%1"');
RegKeyClose(reg);
end;
procedure THIOneCopy.OnAnotherEvent;
var
k: integer;
CL: string;
begin
CL := CmdLine;
k := pos('" "',CL);
if (k<>0) then
begin
delete(CL,1,k + 3);
delete(CL,Length(CL),1);
end