Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2002.03.28;
Скачать: CL | DM;

Вниз

как зарегистрировать свою программу в Windows средствами DelphI   Найти похожие ветки 

 
Sergant ©   (2002-03-16 02:56) [0]

Подскажите, пожалуйста, как зарегистрировать свою программу в Windows средствами DelphI? Т.е., чтобы, допустим, моя программа SuperPPP.exe открывала файлы *.ppp?


 
lipskiy ©   (2002-03-16 03:01) [1]

uses registry;

procedure TForm1.RegisterFileType(prefix:String; exepfad:String);
var
reg:TRegistry;
begin
reg:=TRegistry.Create;
reg.RootKey:=HKEY_CLASSES_ROOT;
//create a new key --> .pci
reg.OpenKey("."+prefix,True);
//create a new value for this key --> pcifile
reg.WriteString("",prefix+"file");
reg.CloseKey;
//create a new key --> pcifile
reg.CreateKey(prefix+"file");
//create a new key pcifile\DefaultIcon
reg.OpenKey(prefix+"file\DefaultIcon",True);
//and create a value where the icon is stored --> c:\project1.exe,0

reg.WriteString("",exepfad+",0");
reg.CloseKey;
reg.OpenKey(prefix+"file\shell\open\command",True);
//create value where exefile is stored --> c:\project1.exe "%1"
reg.WriteString("",exepfad+" "%1"");
reg.CloseKey;
reg.Free;
end;


procedure TForm1.Button1Click(Sender: TObject);
begin
RegisterFileType("pci","c:\project1.exe");
end;



Страницы: 1 вся ветка

Текущий архив: 2002.03.28;
Скачать: CL | DM;

Наверх




Память: 0.46 MB
Время: 0.012 c
3-90751
Fox2001
2002-03-01 12:59
2002.03.28
Blob&Jpeg


1-90945
Yulik
2002-03-14 13:05
2002.03.28
Excel


1-91006
Mina
2002-03-15 11:08
2002.03.28
Помогите пжл....


1-90842
Velocity
2002-03-16 16:45
2002.03.28
Икона для программулины...


3-90784
Akhmadey
2002-03-03 12:44
2002.03.28
Проблема с DBGrig