Показать сообщение отдельно
  #2  
Старый 07.01.2012, 10:50
Pyro Pyro вне форума
Так проходящий
 
Регистрация: 18.07.2011
Сообщения: 805
Версия Delphi: 7Lite
Репутация: 6063
По умолчанию

Google жил, Google жив, Google будет жить!
http://forums.fanatic.net.nz/index.php?showtopic=11758
PHP код:
procedure CreateKeysReg TRegistrykeyCurPath String );
begin
    Reg
.OpenKeykey,True);
    
Reg.WriteString('URL Protocol''');
    
Reg.WriteInteger('EditFlags'0);
    
Reg.WriteString('','URL:' key ' Protocol');
    
Reg.CloseKey;
    
Reg.OpenKeykey '\DefaultIcon'True);
    
Reg.WriteString(''CurPath );
    
Reg.CloseKey;
    
Reg.OpenKeykey '\shell'True );
    
Reg.CloseKey;
    
Reg.OpenKeykey '\shell\open'True );
    
Reg.CloseKey;
end;

procedure TForm1.FormCreate(SenderTObject);
var
    
curPath String;
    
cabstring;
    
Reg TRegistry;
    
I,JInteger;
    
Lucky Boolean;
  
hHWND;
begin

   curPath  
:= ExtractFilePathParamStr(0) );
    if 
curPath[Length(curPath)]<>'\' then
        curPath := curPath + '
\';
    curPath := curPath + ExtractFileName( ParamStr(0) );
    Reg := TRegistry.Create;
    Reg.RootKey := HKEY_CLASSES_ROOT;
    if not Reg.OpenKey( '
icc',False) then begin
       CreateKeys( Reg, '
icc', curPath );
       Reg.OpenKey( '
icc\shell\open\command', True );
       Reg.WriteString('', '"'+curPath + '" 
%1' );
       Reg.CloseKey;
    end
    else
    form1.Close;


    // Code below is what happens when the protocol is ran
  

    if ParamCount>0 then begin
 curPath := ParamStr(1);
if ParamStr(1) = '
notepad' then begin
{Your Code here}
end;

        end
        else
        Application.Terminate;
end; 
Ответить с цитированием