启动程序一直用 ShellExecute, WinExec 这两个,原来 CreateProcess 也可以的,不过网上查了一下,看上去很复杂,估计也用不着,不过很想了解一下这个怎样用,网上资料:
DECLARE INTEGER CreateProcess IN kernel32;
STRING lpApplicationName,;
STRING lpCommandLine,;
INTEGER lpProcessAttributes,;
INTEGER lpThreadAttributes,;
INTEGER bInheritHandles,;
INTEGER dwCreationFlags,;
INTEGER lpEnvironment,;
STRING lpCurrentDirectory,;
STRING lpStartupInfo,;
STRING @ lpProcessInformation
看上去很复杂!
给了个示例:
cProcInfo = Repli(Chr(0), 16)
cStartInfo = PADR(Chr(START_INFO_SIZE),;
START_INFO_SIZE, Chr(0))
= CreateProcess(cApp, NULL, 0,0,0,;
0, 0, SYS(5)+SYS(2003),;
@cStartInfo, @cProcInfo)
估计 cApp='C:\A.EXE' 吧!
关键是这个:cStartInfo = PADR(Chr(START_INFO_SIZE),;
START_INFO_SIZE, Chr(0))
搞不懂,看那位老师说说 CreateProcess 怎样用,谢谢!