我用这段程序在各式windows和机器上都还好,试试?<br>WORD WinExecAndWait32(String CommandLine,int Visibility )<br>{<br> DWORD dwTimeout = 3;<br> DWORD dwRC = WAIT_TIMEOUT;<br> MSG msg;<br> DWORD dw;<br> STARTUPINFO StartupInfo;<br> PROCESS_INFORMATION ProcessInformation;<br><br> ZeroMemory(&StartupInfo, sizeof(STARTUPINFO));<br> StartupInfo.cb = sizeof(STARTUPINFO);<br> StartupInfo.wShowWindow = SW_HIDE;<br><br> ZeroMemory(&ProcessInformation, sizeof(PROCESS_INFORMATION));<br><br> if (CreateProcess(NULL, CommandLine.c_str(), NULL, NULL, NULL, NULL, NULL, NULL, &StartupInfo, &ProcessInformation))<br> {<br><br> // Spin off child process<br>// CloseHandle(ProcessInformation.hProcess);<br><br><br> while (dwRC == WAIT_TIMEOUT)<br> {<br> dwRC = WaitForSingleObject(ProcessInformation.hProcess, dwTimeout);<br><br> while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))<br> {<br> TranslateMessage(&msg);<br> DispatchMessage(&msg);<br> }<br><br> return 1;<br>}<br>而且还调用了dos方式的程序。<br>