 |
CreateProcess ..msdn Add comment W32 Constants Translate this page |
 |
 |
The CreateProcess function creates a new process and its primary thread. The new process runs the specified executable file.
The CreateProcess function is used to run a new program. The WinExec and LoadModule functions are still available, but they are implemented as calls to CreateProcess |
 |
 |
| Code examples: |
 |
|
|
 |
 |
| Declaration: |
 |
 |
BOOL CreateProcess(
LPCTSTR lpApplicationName, // name of executable module
LPTSTR lpCommandLine, // command line string
LPSECURITY_ATTRIBUTES lpProcessAttr, // SD
LPSECURITY_ATTRIBUTES lpThreadAttr, // SD
BOOL bInheritHandles, // handle inheritance option
DWORD dwCreationFlags, // creation flags
LPVOID lpEnvironment, // new environment block
LPCTSTR lpCurrentDirectory, // current directory name
LPSTARTUPINFO lpStartupInfo, // startup information
LPPROCESS_INFORMATION lpProcessInfo // process information
);
|
 |
 |
 |
| FoxPro declaration: |
 |
 |
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
|
 |
 |
 |
| Parameters: |
 |
|
 |
 |
| Return value: |
 |
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call
|
 |
 |
| Usage: |
 |
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)
|
 |
 |
| My comment: |
 |
| See also: ShellExecute, WinExec |
 |
 |
| Word Index links for the CreateProcess : |
 |
|
|
 |
 |
| Translate this page: |
 |
|
 |
 |
| • |
 |
| Created: | 2001-07-12 12:00:00 | | Modified: | 2007-06-11 16:14:13 | Visited in last 7 days: 4240 |