怎样给一个应用程序传递参数?(3分)

E

esri

Unregistered / Unconfirmed
GUEST, unregistred user!
application a---》application b
一些参数
 
请给我一点支持
 
首先 b 要能接受命令行参数。

ShellExecute


HINSTANCE ShellExecute(
HWND hwnd,
LPCTSTR lpOperation,
LPCTSTR lpFile,
LPCTSTR lpParameters,
LPCTSTR lpDirectory,
INT nShowCmd
);
 
可执行文件:sdl.exe
格式:
sdl 123 444

在程序中
if ParamCount > 0 then
begin
form1.Edit1.Text := ParamStr(1);
form1.Edit2.Text := ParamStr(2);
end;

ParamCount ,ParamStr在system.pas


 
我现在能够用这个api传递一个参数怎样传递五个参数?
 
WinExec('YourAppName a b c d e',SW_SHOW);
 
多人接受答案了。
 
顶部