我使用了CreateProcess来运行一个命令,并使用了CREATE_NO_WINDOW标志,但是控制台会在短暂的时间内弹出,如何避免这种情况?
预先感谢您的帮助。
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
ZeroMemory( &pi, sizeof(pi) );
CreateProcess
(
NULL, // No module name (use command line)
command, //set env variable and use it is my command
NULL, // Process handle not inheritable
NULL, // Thread handle not inheritable
FALSE, // Set handle inheritance to FALSE
CREATE_NO_WINDOW, //don't create window but it appears for fraction of second!
NULL, // Use parent's environment block
NULL, // Use parent's starting directory
&si, // Pointer to STARTUPINFO structure
&pi // Pointer to PROCESS_INFORMATION structure
)
预先感谢您的帮助。