我想问问如何使自己程序的特有的文件对应这相应的自己的特有的图标,比如winzip的.zip文件就有自己的图标!谢谢了!
解决方案 »
- 遍历窗体控件问题
- >>>>>>>>紧急求助<<<<<<< 在线等(关于Excel导入Access的)
- 如何调用winXP的API来生成一个zip压缩文件?
- Delphi能提取系统时间吗?
- 文件的传输
- 难道真的没有人会了吗???????????
- 請教:如何實現在Dbgrid的最下面一行顯示上面各列的合計值.
- win98如何登录windows 2000 adv server?
- 请csdn高手,数据库高手,工控高手,帮我分析一下这个问题好吗,本人辗转一星期一筹莫展!
- 薪资大调查:广州DELPHI、VB程序员的薪水为多少RMB/M?????负责项目是什么?
- 1000分求救,请“斑竹”和各位“Delphi高手”入内, 提供类似该问题精彩控件下载网址者,也有分哦!
- 请问各位Delphi生成的EXE程序,运行时是否可以带参数,如DOS那样???如何带???
///////////////////////////
function SetFileAssociation(Ext:string;
OpenApp:string;
FileTypeDescription:string='';
OpenMenuCaption:string='';
IconFile:string='';
IconIndex:integer=0;
Notify:boolean=true):boolean;
var
reg:tregistry;
key:string;
label
final;
begin
result:=false;
if ext='' then exit;
if ext[1]<>'.' then ext:='.'+ext;
//if openmenucaption='' then openmenucaption:='&Open';
if IconFile='' then IconFile:=openapp;
key:=copy(ext,2,length(ext))+' File';
if filetypedescription='' then filetypedescription:=key;//////////////////////////////////////////
try
reg:=tregistry.Create;
reg.RootKey:=hkey_classes_root;
if reg.OpenKey(ext,true) then
begin
reg.WriteString('',key);
reg.CloseKey;
end
else
goto final;
if reg.OpenKey(key,true) then
begin
reg.WriteString('',filetypedescription);
reg.CloseKey;
end
else
goto final;
if reg.OpenKey(key+'\DefaultIcon',true) then
begin
reg.WriteString('',openapp+','+inttostr(iconindex));
reg.CloseKey;
end
else
goto final;
if (OpenMenuCaption<>'') and (reg.OpenKey(key+'\Shell\Open',true)) then
begin
reg.WriteString('',openmenucaption);
reg.CloseKey;
end
else
goto final;
if reg.OpenKey(key+'\Shell\Open\Command',true) then
begin
reg.WriteString('','"'+openapp+'" "%1"');
reg.CloseKey;
end
else
goto final;
if notify then
notifyassociationchange;
result:=true;
final:
finally
reg.Free;
end;
end;
begin
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, nil, nil);
end;
谢谢了1
Application页 Load Icon...按钮