I have to start a process from my C++ code. I am using CreateProcess() function and I have set the following flags in the startupinfo struct. But still the command prompt shows up which I have to close manually to proceed. Please tell me how I can hide this command prompt during th e start up of the process.
si.cb = sizeof(STARTUPINFO);
si.dwFlags = STARTF_USESHOWWINDOW;
si.wShowWindow = SW_HIDE;
the create process call looks like this:
CreateProcess( NULL, // No module name (use command line)
exe, // Command line
NULL, // Process handle not inheritable
NULL, // Thread handle not inheritable
FALSE, // Set handle inheritance to FALSE
CREATE_NEW_CONSOLE, // No creation flags
NULL, // Use parent's environment block
NULL, // Use parent's starting directory
&si, // Pointer to STARTUPINFO structure
&pi );
exe is a string containing the process name to start.
Please tell me how to hide this command prompt during start up of the process. I tried the method described here but it doesn't work. I have a Windows 7 system.
Thanks, Rakesh.
main()orWinMain()?