015
24.01.2006, 19:08 Uhr
xXx
Devil
|
SO:
C++: |
STARTUPINFO si; PROCESS_INFORMATION pi; ZeroMemory( &si, sizeof(si) ); si.cb = sizeof(si); ZeroMemory( &pi, sizeof(pi) ); char cmd[512]; sprintf(cmd, "c:/cygwin/bin/ping.exe -d 127.0.0.1 %d %d", (m_iPaketgroesse-8), m_iAnzahlPing);
for (a=0;a<m_iAusfuehrungPing;a++) { // Start the child process.
if( !CreateProcess( NULL, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi ) ) { printf( "CreateProcess failed (%d).\n", GetLastError() ); return; } } //Ende for-Schleife
// Wait until child process exits. WaitForSingleObject( pi.hProcess, INFINITE );
// Close process and thread handles. CloseHandle( pi.hProcess ); CloseHandle( pi.hThread );
|
|