shellExecute(Application.Hande,nil,'c:\windows\system\msconfig.exe'+#0,
nil,nil,sw_shownormal)uses shellapi

解决方案 »

  1.   

    另外一种还算可以的方法就是通过ole控件进行调用!
      

  2.   

    winexec()
    shellExecute()
    都可以
      

  3.   

    winexec 针对 可执行文件
    Winexec('Notepad.exe help.txt',sw_Normal);
    shellexecute 针对 windows中的所有文件 他会找到windows登记了的对应程序打开对应文件
    ShellExecute(0, 'open', 'dd.txt', nil, nil, SW_SHOW);
      

  4.   

    用 API 函数:WinExec 或 ShellExecute 或 CreateProcess。 
    procedure TForm1.Button1Click(Sender: TObject);
    var
      sCommandLine: string;
      bCreateProcess: boolean;
      lpStartupInfo: TStartupInfo;
      lpProcessInformation: TProcessInformation;
    begin
      sCommandLine := 'D:\TEMP\TEST.EXE';
      FillChar(lpStartupInfo, Sizeof(TStartupInfo), #0);
      lpStartupInfo.cb := Sizeof(TStartupInfo);
      lpStartupInfo.dwFlags := STARTF_USESHOWWINDOW;
      lpStartupInfo.wShowWindow := SW_NORMAL;  bCreateProcess := CreateProcess(nil, PChar(sCommandLine),
        nil, nil, True, CREATE_NEW_CONSOLE or NORMAL_PRIORITY_CLASS,
        nil, nil, lpStartupInfo, lpProcessInformation);
    end;      | 
              |
           LPCTSTR (C),工作目录 
      

  5.   

    WinExec和CreateProcess其实就是版本的区别,WinExec是针对以前的Windows,现在的32位以上的Windows都应该用CreateProcess。
    还有就是ShellExecute是打开或打印所有文件的,如果那个文件是可执行文件就运行那个程序,而CreateProcess 就纯粹是运行一个应用程序了。