要么试试CreateProcess
function CreateProcessAndWait(const AppPath, AppParams: String;
Visibility: word): DWord;
var
SI: TStartupInfo;
PI: TProcessInformation;
Proc: THandle;
begin
FillChar(SI, SizeOf(SI), 0);
SI.cb := SizeOf(SI);
SI.wShowWindow := Visibility;
if not CreateProcess(PChar(AppPath), PChar(AppParams), Nil, Nil, False,
Normal_Priority_Class, Nil, Nil, SI, PI) then
raise EExecuteError.CreateFmt('Failed to execute program. Error Code %d',
[GetLastError]);
Proc := PI.hProcess;
CloseHandle(PI.hThread);
if WaitForSingleObject(Proc, Infinite) <> Wait_Failed then
GetExitCodeProcess(Proc, Result);
CloseHandle(Proc);
end;
function CreateProcessAndWait(const AppPath, AppParams: String;
Visibility: word): DWord;
var
SI: TStartupInfo;
PI: TProcessInformation;
Proc: THandle;
begin
FillChar(SI, SizeOf(SI), 0);
SI.cb := SizeOf(SI);
SI.wShowWindow := Visibility;
if not CreateProcess(PChar(AppPath), PChar(AppParams), Nil, Nil, False,
Normal_Priority_Class, Nil, Nil, SI, PI) then
raise EExecuteError.CreateFmt('Failed to execute program. Error Code %d',
[GetLastError]);
Proc := PI.hProcess;
CloseHandle(PI.hThread);
if WaitForSingleObject(Proc, Infinite) <> Wait_Failed then
GetExitCodeProcess(Proc, Result);
CloseHandle(Proc);
end;
我现在用的是《VC6技术内幕》的砖头。有没有DELPHI的书?或有调用的
例程的书。
有中文的吗?在那里有呢?我现在手中什么都没有……
CreateProcess是专为以后的Windows用的,等于WinExec的升级版本
还有ShellExecute是打开文件(用和这文件相连的打开方式)或直接运行程序
听说快出 DDG6 了, 是不是真的?
可以发到我的E-MAIL吗:
[email protected]
小弟这里不胜感激。