Kingron(WinAPI)能具体说一下吗?
解决方案 »
- 修改本地日期和时间,应是2013-03-03 01:13:00,却变成2013-03-03 09:13:00
- DELPHI如何SQL数据库中多个表的信息通过控件查询并分别导出为EXCEL文件
- 拦截到WM_COMMAND后如何让此消息不执行
- 散分送工具 代码变更助手2008
- 关于delphi控件
- 紧急求助!主程序关闭时如何关闭所有已经加载的dll及窗体?
- 网上哪里可以找到类似Decision cube的决策分析控件,支持ADO
- 广西的IT同行请进!来着有分哦。
- 请帮忙看看吧!
- XE6下的UTF8转换怎么老转不完整,大家帮帮忙
- 随便讨论一下: 什么情况下你会把一个变量设定为属性使用
- 大虾请进,关于ListView
我要回复 | 我感兴趣 | 打印贴子 | 推荐给朋友 | 关闭窗口
主 题:如何让自己写的浏览器和html文件关联后,双击html文件就用自己的浏览器打开了!
作 者:gander
所属论坛:Delphi
问题点数:22
回复次数:10
发表时间:2001-2-1 16:50:00
回复贴子:
回复人:ether(void) (2001-2-1 16:54:00) 得0分
写一个注册程序:
procedure registerfiletype(ft,key,desc,icon,prg:string);
var myreg : treginifile;
ct : integer;
begin
// make a correct file-extension
ct := pos('.',ft);
while ct > 0 do begin
delete(ft,ct,1);
ct := pos('.',ft);
end;
if (ft = '') or (prg = '') then exit; //not a valid file-ext or ass. app
ft := '.'+ft;
try
myreg := treginifile.create('');
myreg.rootkey := hkey_classes_root; // where all file-types are described
if key = '' then key := copy(ft,2,maxint)+'_auto_file'; // if no key-name is given,
// create one
myreg.writestring(ft,'',key); // set a pointer to the description-key
myreg.writestring(key,'',desc); // write the description
if icon <> '' then
myreg.writestring(key+'\DefaultIcon','',icon); // write the def-icon if given
myreg.writestring(key+'\shell\open\command','',prg+' %1'); //association
finally
myreg.free;
end;
showmessage('File-Type '+ft+' associated with'#13#10+
prg+#13#10);
end;注册:
registerfiletype(
'.htm',
'My HTML file',
'My HTML File',
'c:\tmp\test.exe',
'c:\tmp\test.exe');
回复人:gameboy999(无名) (2001-2-1 17:00:00) 得0分
给他分楼!:)
回复人:henry3(亨利三世) (2001-2-26 19:44:00) 得0分
修改注册表呀。
回复人:Kingron(WinAPI) (2001-2-26 21:11:00) 得0分
哈哈,没有抢到
回复人:dana(dana) (2001-3-2 14:44:00) 得0分 如何让浏览器和html文件关联!!!
回复人:严黎斌() (2001-3-2 15:10:00) 得0分
我会,但是我从来不这么干。
我痛恨这种程序,特别是在不好好征求用户选择的情况下,:
将程序作为自动启动。
修改文件关联,特别是html,txt,mp3, dat等重要类型。
回复人:Kingron(WinAPI) (2001-3-2 15:11:00) 得0分
registerfiletype(
'.html',
'My HTML file',
'My HTML File',
'c:\tmp\test.exe',
'c:\tmp\test.exe');
回复人:Kingron(WinAPI) (2001-3-2 15:26:00) 得0分
哈哈,都是XICQ惹的祸!!!!!
回复人:BCB([email protected]) (2001-3-2 15:57:00) 得0分
OICQ会改变缺省浏览器,这点太讨厌,
我只好用Iexplor.exe将TBrowser.exe
盖了
回复人:BCB([email protected]) (2001-3-2 16:04:00) 得0分
有没有不写注册表,直接用API函数注册文件类型!