Verwendung von OpenProcess

gute Frage...wie komme ich auf &pi, wenn da ganz eindeutig parameter 2 steht :rolleyes:
sorry...war wohl ein wenig geistig abwesend.

Vielen vielen Dank für die umfangreiche Hilfe euch beiden.

Hier nochmal der Quellcode für die, die auch das gleiche Problem haben:

C++:
 STARTUPINFO si;
    PROCESS_INFORMATION pi;
    ZeroMemory( &si, sizeof(si) );
    si.cb = sizeof(si);
    ZeroMemory( &pi, sizeof(pi) );
 TCHAR* path = new TCHAR[1000000];

 _tcscpy(path, _T("Exe Datei mit Pfad"));
  
    // Start the child process. 
    if( !CreateProcess( NULL,   // No module name (use command line). 
        path, // Command line. 
        NULL,             // Process handle not inheritable. 
        NULL,             // Thread handle not inheritable. 
        FALSE,            // Set handle inheritance to FALSE. 
        0,                // No creation flags. 
        NULL,             // Use parent's environment block. 
        NULL,             // Use parent's starting directory. 
        &si,              // Pointer to STARTUPINFO structure.
        &pi )             // Pointer to PROCESS_INFORMATION structure.
		) {  // FEHLER }
    // Close process and thread handles. 
    CloseHandle( pi.hProcess );
    CloseHandle( pi.hThread );
    delete[] path;


Edit: Wusste gar nicht, dass es sowas gibt. Sieht aber natürlcih viel besser aus :)
 
Zuletzt bearbeitet:
Warum verwendest du denn für Code immer Zitat Tags? Überarbeite doch bitte nochmal den Beitrag und nimm Codetags für deinen C++ Code.

Du solltest path wenn du die Variable nicht mehr benötigst wieder mit delete[] freigeben.

Gruß
 
Zurück