用Delphi如何直接打开.chm的帮助文件,我用winexec() 和shellexecute()都不行,急!!!!!

解决方案 »

  1.   

    procedure TForm1.Button1Click(Sender: TObject);
    var
    p:pchar;
    begin
      if FileExists(ExtractFilePath(Application.Exename)+'YLJXC.chm') then
       begin
        p:=pchar(ExtractFilePath(Application.Exename)+'YLJXC.chm');
        ShellExecute(0, nil, p, nil, nil, SW_NORMAL);
       end
      else
       begin
        p:=pchar(ExtractFilePath(Application.Exename)+'Index.HTM');
        ShellExecute(0, nil, p, nil, nil, SW_NORMAL);
       end;
    end;
      

  2.   

    ShellExecute出错要在uses中加什么????
      

  3.   

    uses中包含ShellAPI
    begin
    Application.HelpFile := ExtractFilePath('Application.ExeName');
    ShellExecute(0, 'open', PChar(Application.HelpFile+'Help.chm'), nil, nil, SW_SHOW);
    end;