Group: Process and Thread - Library: kernel32
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
Start an executable from VFP application by using the CreateProcess
Starting external program from VFP and waiting for its termination
Running MSDOS Shell as a child process with redirected input and output (smarter RUN command)
How to make application automatically close all documents it opened
How to prevent users from accessing the Windows Desktop and from switching to other applications
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
);
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
If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call
See also: ShellExecute, WinExec.