小
小飞龙
Unregistered / Unconfirmed
GUEST, unregistred user!
我需要启动一个程序,隐藏方式.<br> WinExec('C:/PreInstaller.exe',SW_HIDE);<br> //ShellExecute(0,'open','C:/PreInstaller.exe',nil,nil,SW_HIDE);<br>function WinExecExW(FileName: pchar; visiable: integer): DWORD;<br>var<br> StartupInfo: TStartupInfo;<br> ProcessInfo: TProcessInformation;<br>begin<br> FillChar(StartupInfo, SizeOf(StartupInfo), #0);<br> StartupInfo.cb := SizeOf(StartupInfo);<br> StartupInfo.dwFlags := STARTF_USESHOWWINDOW;<br> StartupInfo.wShowWindow := SW_HIDE;<br> //StartupInfo.dwX:=100;<br> //StartupInfo.dwY:=10;<br> if not CreateProcess(FileName, nil, nil, nil, false, NORMAL_PRIORITY_CLASS, nil, nil,<br> StartupInfo, ProcessInfo) then<br> result := 0<br> else<br> begin<br> WaitForSingleObject(processinfo.hProcess, INFINITE);<br> GetExitCodeProcess(ProcessInfo.hProcess, Result);<br> CloseHandle(ProcessInfo.hProcess);<br> CloseHandle(ProcessInfo.hThread);<br> end;<br>end;<br><br>几种方法都不行.<br>想用<br> //StartupInfo.dwX:=100;<br> //StartupInfo.dwY:=10;<br>改变程序的位置也做不到.谁有办法.