简单问题:请教如何调用一个可执行文件?是用Winexec吗?并且要求该程序只能运行一次呢?能给个例子吗?
解决方案 »
- 如何获取DBGRID选中单元格的坐标
- 企业盘点表SQL的写法?请教高手!在线急等!!!!!!
- 新人询问 由于时间比较紧 烦请在线高手帮助解答
- 转贴分享:delphi字符串函数
- 用ADO连EXCEL报错:在对应所需名称或序数的集合中,未找到项目。
- 请问,谁有 ClassExplorer
- 各位高手解释一下为什么!
- 发了N个帖子没有解决问题,郁闷!散分!!!分数不够再加!!!
- 一个Delphi和asp的问题:Delphi程序安装到win2000上后执行asp程序,不明白。。看里面。。
- 菜鸟的问题:如何将string类型转换成array of char,答了就给分
- 调用OpenFileName这个API,怎么可以获得多选文件的列表?
- 如何使用ADOQuery+Dbgrid根据两个主表显示一个从表里对应的数据
bShowWindow: Boolean; PI: PProcessInformation): Boolean;
var
StartupInfo : TStartupInfo;
ProcessInformation: TProcessInformation;
begin
FillChar(StartupInfo, SizeOf(TStartupInfo), 0);
with StartupInfo do
begin
cb := SizeOf(TStartupInfo);
dwFlags := STARTF_USESHOWWINDOW;
if bShowWindow then
wShowWindow := SW_NORMAL
else
wShowWindow := SW_HIDE;
end;
Result := CreateProcess(nil, PChar(Command),
nil, nil, True, NORMAL_PRIORITY_CLASS, nil, nil,
StartupInfo, ProcessInformation);
if not Result then
Exit;
if bWaitExecute then
WaitForSingleObject(ProcessInformation.hProcess, INFINITE);
if Assigned(PI) then
Move(ProcessInformation, PI^, SizeOf(ProcessInformation));
end;
调用示例
MyExecute('C:\WINNT\system32\net.exe send huo aa',true,true,nil);