I want to create a process with syntax similar to the following,except that I don't want to create a thread:
hThread = CreateThread(
NULL, // no security attribute
0, // default stack size
InstanceThread, // thread proc
(LPVOID) hPipe, // thread parameter
0, // not suspended
&dwThreadId); // returns thread ID
But I've checked the reference for CreateProcess
and a sample :
BOOL result = ::CreateProcess(
L"C:\\Windows\\NOTEPAD.exe",
NULL,
NULL,
NULL,
FALSE,
NORMAL_PRIORITY_CLASS,
NULL,
NULL,
&startupInfo,
&processInformation
);
It seems I must specify an existing executable to create a process? How can I create one by a callback similar to InstanceThread
?