?
nimm am besten create process:
////////////////////////////////////////////////////////////////
// ERZEUGEN EINES PROZESSES
// Aufruf von NOTEPAD
#include <iostream.h>
#include <process.h>
#include <windows.h>
void main( void ) {
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory( &si, sizeof(si) ); // fülle Speicherbereich mit NULL
si.cb = sizeof(si); // Grösse des Speicherbereichs
ZeroMemory( &pi, sizeof(pi) ); // fülle Speicherbereich mit NULL
bool ok = CreateProcess( NULL, "Notepad.exe", NULL, NULL,FALSE,
0, NULL, NULL, &si, &pi )
if (!ok) cout << "CreateProcess failed." ;
// PROCESSINFORMATION abfragen:
cout << "Kind-Prozess ID: " << pi.dwProcessId << endl;
cout << "Kind-Prozess HANDLE: " << pi.hProcess << endl;
cout << "Kind-Prozess Thread-HANDLE: " << pi.hThread << endl;
cout << "Kind-Prozess Thread-ID: " << pi.dwThreadId << endl;
// Wait until child process exits.
WaitForSingleObject( pi.hProcess, INFINITE );
// Close process and thread handles.
CloseHandle( pi.hProcess );
CloseHandle( pi.hThread );
}
viel spaß;-)
cu