Neues Fenster während einer Aufgabe



  • Hallo,
    ich programmiere ein Program ( 🙂 ) das auf dem Zielrechner
    die Registry duechsucht und je nach Ergebnis Programme (JDK,Textpad,Cygwin..)
    installiert.
    Den Installprocess rufe ich so auf:

    boolean startXandWait(CString xPfad){
    
        LPTSTR lpsz = new TCHAR[xPfad.GetLength()+1];
        _tcscpy(lpsz, xPfad);
    
        STARTUPINFO si;
        PROCESS_INFORMATION pi;
    
        ZeroMemory( &si, sizeof(si) );
        si.cb = sizeof(si);
        ZeroMemory( &pi, sizeof(pi) );
    
        // Start the child process. 
        if( !CreateProcess( NULL, // No module name (use command line). 
            lpsz,               // 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.
        ) 
        {        
            return false;
        }
    
        // Wait until child process exits.
        WaitForSingleObjectEx( pi.hProcess, INFINITE , FALSE);
    
        // Close process and thread handles. 
        CloseHandle( pi.hProcess );
        CloseHandle( pi.hThread );
        return true;
    }
    

    Während der Instalationszeit ist mein Programm beim Warten,
    es wird garnicht richtig angeziegt. Auch etwa 10 sekunden nach z.B.
    Abbruch des setup.programms ist es nur weiß.
    Kann man das umgehen ? So das ich etwas in der Zeit anzeige, also ein
    anderes kleines Fenster z.B. ??

    Thx



  • Ja mit einem Thread oder mit UpdateWindow() und die Messagewarteschlange auslesen.
    Thread bitte suchfunktion nutzen.



  • LPTSTR lpsz = new TCHAR[xPfad.GetLength()+1];
    _tcscpy(lpsz, xPfad);
    

    😕
    Wozu?
    😕


Anmelden zum Antworten