怎么在delphi项目里调用一个exe的应用程序?

解决方案 »

  1.   

    没错:用WinExec或ShellExecute
    常用ShellExecute.
      

  2.   

    ShellExecute(Handle,nil,'notepad.exe',nil,nil,SW_ShowNormal);
      

  3.   

    来晚了,但shellexecute比较好点,不容易出错
      

  4.   

    同意,那俩个函数都可以,具体的查看一下帮助但,请问楼上的,难道使用winexec 就容易出错
    请分析一下 俩者的 …………
      

  5.   

    WinExec是为了和老板本的windows兼容
      

  6.   

    用shellexecute是不是要uses 哪个单元呀,不能用不起呀,请楼上的兄弟指点一下.
      

  7.   

    ShellExecute吧, 这个是微软推荐用的, 
    WinExec快过时了:)~~~
      

  8.   

    WinExec 用于以前16位程序
    ShellExecute 推荐
      

  9.   

    ShellExecute(Handle,nil,'QQ.exe',nil,nil,SW_ShowNormal);
      

  10.   

    这个是DELPHI提供的一个函数,你可以引入
    %DelphiHome%\Demos\Doc\Filmanex\FmxUtils.pas这个文件,就可以直接使用function ExecuteFile(const FileName, Params, DefaultDir: string;
      ShowCmd: Integer): THandle;
    var
      zFileName, zParams, zDir: array[0..79] of Char;
    begin
      Result := ShellExecute(Application.MainForm.Handle, nil,
        StrPCopy(zFileName, FileName), StrPCopy(zParams, Params),
        StrPCopy(zDir, DefaultDir), ShowCmd);
    end;
      

  11.   

    use ShellAPI
    ShellExecute(Handle,nil,'notepad.exe',nil,nil,SW_ShowNormal);