flash文件关联(100分)

H

halqj

Unregistered / Unconfirmed
GUEST, unregistred user!
我自己做了个Flash播放文件,可以播放SWF文件,现在是如何关联到SWF文件,让其他用户只要双击SWF文件就可以打开我的程序,注册表我修改了Boot里面的Flashfile下的Command默认值为我的程序位置,Machine下Classes中的Flashfile中的Command我也修改为了我的程序位置,都不行,主要是我改变关联后一直查不到MS是怎么关联的,所以就做不出来这一步了,谁能帮我?
 
procedure TForm1.Button1Click(Sender: TObject);
begin

WriteRegString(HKEY_CLASSES_ROOT,'.swf','','FlashFile');
WriteRegString(HKEY_CLASSES_ROOT,'FlashFile/shell/Open/command','',
ParamStr(0) + ' %1');
end;


procedure TForm1.WriteRegString(const ARoot: HKEY;
const APath, AKey,
AValue: String);
var
s: TRegistry;
begin

s := TRegistry.Create;
try
s.RootKey := ARoot;
s.OpenKey(APath,True);
s.WriteString(AKey,AValue);
finally
s.CloseKey;
s.Free;
end;

end;


procedure TForm1.FormCreate(Sender: TObject);
begin

Caption := ParamStr(1);
end;
 
我将默认图标一块放入后,怎么图标显示的还是原来的图标?
 
if Reg.OpenKey('/flashfile/defaultIcon',True) then

Reg.WriteString('',sValue);
if Reg.OpenKey('/flashfile/shell/open/command',True) then

sValue:=sValue+' %1';
Reg.WriteString('',sValue);
Svalue为文件路径
 
先看看注册表里面是否修改正确,如果已经修改正确了,注销一下系统,重新登陆后图标就改过来了。
 
有没有更好的办法,不注销,最好是刷新系统代码
 
接受答案了.
 
顶部