在delphi中如何显示CHM文件?
CHM文件就在工程文件所在的文件夹下~
改如何实现`
还有调用txt文件又该如何`?
请教了  ~         ^-^        ~~~~

解决方案 »

  1.   

    CHM文件用
    SellExecute(handle,nil,pchar('a.chm'),nil,nil,sw_shownormal);
    txt文件直接读取就行了
    SellExecute也行
    会用记事本打开
      

  2.   

    SellExecute(handle,'open',pchar('a.chm'),nil,nil,sw_shownormal);
                                    --------
                                  要打开的文件名
      

  3.   

    对了,
    需要uses shellapi;
      

  4.   

    不放心的话可以用hh.exe来开chm文件。
    hh已经在系统路径里,后面直接跟chm的文件名就行。(可以用winexec省事了)
      

  5.   

    keydownif key = vk_f1 then
      SellExecute(handle,'open',pchar('a.chm'),nil,nil,sw_shownormal);
      

  6.   

    WinExec('HH.EXE D:\help.chm',SW_NORMAL);   //hh.exe  是chm的执行程序
      

  7.   

    procedure TFrmMain.FormKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    begin
      if Key = VK_F1 then 
        WinExec(PChar('hh.exe'+'.\a.chm'),SW_SHOW);
    end;
      

  8.   

    还有一种方法:
        首先把帮助文件与程序连接起来:"Project->Options",按"Browse",选择帮助文件,点OK
        其次在程序中调用帮助文件:
        以内容调用:
            application.helpcommand(help_contents,0);
        以查找调用:
            application.helpcommand(help_finder,0);
      

  9.   

    winhelp(form1.clienthandle,'.\media.hlp',help_contents,0); //显示
    winhelp(form1.clienthandle,'.\media.hlp',help_key,0); //显示索引页
    winhelp(form1.ClientHandle,'.\media.hlp',HELP_HELPONHELP,0); //调用WIN帮助文件searchstr:='退出';
    winhelp(form1.clienthandle,'.\media.hlp',help_key,longint(pchar(searchstr)));其实已经说的挺明白了!就是来热闹一下!!上面是几种不同的显示方法。希望对你有帮助。
      

  10.   

    to: root3646(虫子) 你说的是hlp文件,这里讨论的是CHM文件
    你会打开CHM的显示索引页吗,或者是定位到某一页
    会的话我另外开贴给分,呵呵