shellexecute(handle,'open','c:\windows\desktop\aa.chm','','',sW_show);

解决方案 »

  1.   

    function ShellExecute(hWnd: HWND; Operation, FileName, Parameters,
                          Directory: PChar; ShowCmd: Integer): HINST; stdcall;
    返回值 
      非零表示成功,零表示失败。会设置GetLastError 
    参数表 参数    类型及说明 
    hwnd       指定一个窗口的句柄,有时候,windows程序有必要在创建自己的主窗口
               前显示一个消息框 
    Operation  指定字串“open”来打开FlieName文档,
               或指定“Print”来打印它 
    FileName   想用关联程序打印或打开一个程序名或文件名 
    Parameters 如FlieName是可执行文件,则这个字串包含传递给执行程序的参数 
    Directory  想使用的完整路径 
    ShowCmd    定义了如何显示启动程序的常数值。
               参考ShowWindow函数的nCmdShow参数 
      

  2.   

    编译都通不过,请指教!!
    后面不要external 'Shell32.DLL';吗??
      

  3.   

    这个就可以,在  use 中包含 ShellAPI
    /********************************************************/
    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs
      , shellapi, StdCtrls;type
      TForm1 = class(TForm)
        Button1: TButton;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.DFM}procedure TForm1.Button1Click(Sender: TObject);
    begin
      shellexecute(handle,pchar('open'),pchar('E:\qmp\exmp\usechm\hubdog.chm'),nil,nil,sw_show);
    end;end.