如何执行外部程序(50分)

  • 主题发起人 主题发起人 cao192
  • 开始时间 开始时间
C

cao192

Unregistered / Unconfirmed
GUEST, unregistred user!
执行外部EXE文件
 
uses ShellAPI;<br><br>ShellExecute(GetDesktopWindow, 'open', '你的外部应用程序的路径', nil, nil, 0);<br><br><br>
 
uses WinProcs; &nbsp; <br>&nbsp;..... &nbsp; <br>begin &nbsp; <br>&nbsp; WinExec(......); &nbsp; <br>.......... &nbsp;<br>end. &nbsp; <br><br>和调用Pascal库函数没什么两样。<br>&nbsp; &nbsp;<br>例如:<br>WinExec('c:/windows/calc.exe',SW_SHOWNORMAL); //启动计算器<br>函数原型为:<br>UINT WinExec(<br>LPCSTR lpCmdLine, // address of command line <br>UINT uCmdShow // window style for new application <br>); <br>
 
多人接受答案了。
 
问题:如何执行外部程序 ( 积分:50, 回复:3, 阅读:29 )<br>分类:Windows API ( 版主:amo, cAkk ) &nbsp;<br>来自:cao192, 时间:2001-12-25 14:48:00, ID:811264 [显示:小字体 | 大字体] &nbsp;<br>执行外部EXE文件<br>&nbsp;<br>&nbsp;<br>来自:卷起千堆雪tyn, 时间:2001-12-25 14:53:00, ID:811277 <br>uses ShellAPI;<br><br>ShellExecute(GetDesktopWindow, 'open', '你的外部应用程序的路径', nil, nil, 0);<br><br><br><br>&nbsp;<br>&nbsp;<br>来自:free_knight, 时间:2001-12-25 14:57:00, ID:811301 | 编辑 <br>uses WinProcs; &nbsp; <br>&nbsp;..... &nbsp; <br>begin &nbsp; <br>&nbsp; WinExec(......); &nbsp; <br>.......... &nbsp;<br>end. &nbsp; <br><br>和调用Pascal库函数没什么两样。<br>&nbsp; &nbsp;<br>例如:<br>WinExec('c:/windows/calc.exe',SW_SHOWNORMAL); //启动计算器<br>函数原型为:<br>UINT WinExec(<br>LPCSTR lpCmdLine, // address of command line <br>UINT uCmdShow // window style for new application <br>); <br><br>&nbsp;<br>&nbsp;<br>来自:cao192, 时间:2001-12-25 15:22:00, ID:811367 <br>多人接受答案了<br>&nbsp;<br>&nbsp;<br>
 
后退
顶部