调用test6.exe 为例,通过客户端调用没有闪烁。
#include "windows.h"
#include <string>
#include "windows.h"
#include <string>
std::string fullCommandLine = "\"C:\\Documents and Settings\\kevin.chen\\My Documents\\Visual Studio 2005\\Projects\\Test6\\debug\\test6.exe \"";
STARTUPINFOA startupInfo;
PROCESS_INFORMATION processInfo;
memset(&startupInfo, 0, sizeof(startupInfo));
memset(&processInfo, 0, sizeof(processInfo));
startupInfo.cb = sizeof(startupInfo);
startupInfo.dwFlags = STARTF_USESHOWWINDOW;
startupInfo.wShowWindow = SW_HIDE;
bool fsuccess = CreateProcessA( 0,
(LPSTR)(LPCSTR)fullCommandLine.c_str(), 0, 0, false,
CREATE_DEFAULT_ERROR_MODE, 0, 0,
&startupInfo, &processInfo) ;
}