哪位大虾能告诉我,在Delphi中怎样执行其它应用软件。在线等候。

解决方案 »

  1.   

    winexec函数!
    第一个参数为所执行文件名,第二个参数为显示方式,详细的可以看一下
    Delphi的帮助。
      

  2.   

    WinExec(‘app.exe', SW_Show)
    和Uses ShellAPI的ShellExecute也可以
      

  3.   

    执行程序外文件:
    1WinExec 或
    2Uses ShellAPI;
    3ShellExecute
    具体可以查看Win32 SDK的Help
    2uCmdShow的参数有SW_HIDE          
    SW_MAXIMIZE
    SW_MINIMIZE                   
    SW_RESTORE                                                       
    SW_SHOW                            SW_SHOWDEFAULT                                        
    SW_SHOWMAXIMIZED
    SW_SHOWMINIMIZED
    SW_SHOWMINNOACTIVE
    SW_SHOWNA Displays 
    SW_SHOWNOACTIVATE
    SW_SHOWNORMAL
    WINEXEC//调用可执行文件
    winexec('command.com /c copy *.* c:\',SW_Normal);
    winexec('start abc.txt');
    ShellExecute或ShellExecuteEx//启动文件关联程序
    function executefile(const filename,params,defaultDir:string;showCmd:integer):THandle;
    ExecuteFile('C:\abc\a.txt','x.abc','c:\abc\',0);
    ExecuteFile('http://xxx.263.net','','',0);
    ExecuteFile('mailto:[email protected]','','',0);
      

  4.   

    Uses ShellApi;ShellExecute(Handle,'open','Path',nil,nil,Sw_Show)