Kingron(WinAPI)能具体说一下吗?

解决方案 »

  1.   

    http://www.csdn.net/expert/topic/63/63526.shtm
    我要回复 | 我感兴趣 | 打印贴子 | 推荐给朋友 | 关闭窗口  
    主  题:如何让自己写的浏览器和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函数注册文件类型!