在Delphi中,有没有象VB中的Shell函数,可以调用已经存在的EXE文件。

解决方案 »

  1.   

    一样的阿,ShellExcute,引用shellapi单元
      

  2.   

    ShellExecute()是让外壳程序来调用EXE,得不到更多的信息(比方说不知道该EXE文件是否已初始化完毕,是否已运行结束),而WinExe已废弃不用,最好的做法是CreateProcess()
      

  3.   

    procedure TForm1.Button1Click(Sender: TObject);
    begin
      ShellExecute(Handle, nil,'notepad.exe',nil,'C:\winnt', SW_SHOW);
    end;
    uses shellapi;
      

  4.   

    捡分阿winexec('c:\winnt\NOTEPAD.EXE',SW_show);最简单的shellexecute的话就像上面的吧
      

  5.   

    ShellExecute(Handle,'open',PChar('Display.exe'),nil,nil,SW_SHOW);用这个就行了
      

  6.   

    使用CreateProcess(CreateProcessAsUser)来运行程序,并使用waitforsingleobject可以等待程序运行完毕在继续执行代码
      

  7.   

    Shellexecute(handle,'open',Pchar(ExtractFilePath(Application.exeName)+'CXBB'),nil,nil,SW_SHOWNORMAL);Pchar(ExtractFilePath(Application.exeName):用此取得当前运行程序的路径;
    )+'CXBB':此为被调用的程序CXBB.EXE;
    如此就能调用与主程序在同一文件夹内的子程序CXBB.EXE了;
    如果要调用特定路径中程序,只需要将Pchar(ExtractFilePath(Application.exeName)+'CXBB'写成带路径的形式如:以:C:\CXBB.EXE
      

  8.   

    ShellAPI的ShellExecute
    WInEXEC
    CreateProcess都可以的看MSDN就最好的
      

  9.   

    ShellExecute(Handle, nil,'notepad.exe',nil,'C:\winnt', SW_SHOW);