T
terrace
Unregistered / Unconfirmed
GUEST, unregistred user!
begin<br> ZeroMemory(@lSI,sizeof(lSI)) ;<br> lSI.cb := SizeOf(lSI);<br> lSI.dwFlags := STARTF_USESHOWWINDOW;<br> lSI.wShowWindow := SW_SHOWNORMAL;<br> CreateProcess(nil,PChar('c:/func/project1.exe'),nil,nil,false,0,nil,nil,lSI,lPI);<br> h:=OpenProcess(PROCESS_QUERY_INFORMATION,true,lpi.dwProcessId);<br>end;<br>进程已经创建成功了,可为什么OpenProcess返回给h的值为0呀即调用失败,<br>我将h:=OpenProcess(PROCESS_QUERY_INFORMATION,true,lpi.dwProcessId)改<br>为h:=OpenProcess(PROCESS_QUERY_INFORMATION,true,lpi.hProcess);仍然返回<br>0即失败,请高手指点,谢谢!!!<br>