我对注册类型稍有了解,但具体过程尚不知,能否给我个样例。谢谢。
解决方案 »
- delphi StringGrid
- 哪位大哥可以提供能使现有程序界面能变成XP风格的控件,谢谢?
- 如何响应动态创建控件的鼠标双击事件??请高手指教……
- 各位大个,小弟查询时想安顺序,group by记录,但是group 中包含记录的个数随机的,现在小弟用dataset,修改每个记录的group id ,然后使用grou
- 如何实现点对点通讯???
- QuantumGrid在Delphi中安装后,运行Delphi6时报什么函数找不到入口,为什么?
- 关于控件次序问题
- 有做过外挂的兄弟吗?麻烦进来讲讲功能与原理!
- Socket编程,聊天软件的问题求助
- 有关STRINGGRID的问题!请来看看,急!
- 判断字段不能为空的问题!
- 用过DX控件请进.
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,registry, OleCtrls, ShockwaveFlashObjects_TLB, Menus;type
TForm1 = class(TForm)
MainMenu1: TMainMenu;
flash1: TMenuItem;
ShockwaveFlash1: TShockwaveFlash;
procedure flash1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;
myreg,reg:TRegistry;
a:boolean; //文件关联
implementation{$R *.dfm}procedure TForm1.Flash1Click(Sender: TObject);
var
abc:string;
abd:string;
begin
myreg:=Tregistry.Create;
if a=false then
begin
try
with myreg dobegin
abd:=extractfilepath(paramstr(0))+'Player.exe,1';
abc:=extractfilepath(paramstr(0))+'Player.exe %1';
myreg.RootKey:=HKEY_CLASSES_ROOT; if Openkey('\.swf\shell\open\command',true) then
begin
writestring('',abc);
myreg.CloseKey;
end;
if openkey('\.swf\shell\open',true) then
begin
writestring('','用Player播放');
myreg.CloseKey;
end; if openkey('\.swf\DefaultIcon',true) then
begin
writestring('',abd);
myreg.Free;
showmessage('**** 关联文件完毕! ****');
flash1.Checked:=true;
flash1.Caption:='取消关联';
a:=true;
end;
end;except
showmessage('对不起,关联失败了 :(');
end;endelse
begin
try
with myreg do begin
myreg.RootKey:=HKEY_CLASSES_ROOT;
myreg.DeleteKey('.swf');
myreg.Free;
showmessage('**** 取消文件关联完毕! ****');
flash1.Checked:=false;
flash1.Caption:='关联flash';
a:=false;
end;except
showmessage('对不起,关联失败了 :(');
end;end;end;
procedure TForm1.FormCreate(Sender: TObject);
begin
if Paramstr(1)<>'' then
begin
shockwaveflash1.Movie:=Paramstr(1);
shockwaveflash1.Play;
end;
reg:=TRegistry.create;
reg.RootKey:=HKEY_CLASSES_ROOT;
with reg do
begin
reg.OpenKey('\.swf\shell\open',false);
if reg.readstring('')='用Player播放' then
begin
a:=true;
flash1.Checked:=true;
reg.Free;
end
else
begin
a:=false;
flash1.Checked:=false;
reg.Free;
end;
end;end;end.