Einzelnen Beitrag anzeigen

FaNIX

Registriert seit: 8. Okt 2007
36 Beiträge
 
#8

Re: TerminateProcess not working correctly....

  Alt 22. Okt 2007, 10:24
Zitat von sirius:
Just use MSDN-Library durchsuchenwaitforsingleobject with a time out intervall of 0 milliseconds
Ahhh genius!!! It work's perfectly... thanks mate!

Delphi-Quellcode:
    try
        //Create the Desktop
        Desktop.CreateDesktop(VIRTUAL_DESKTOP);

        FillChar(sinfo, SizeOf(sinfo), 0);
        sinfo.cb := SizeOf(sinfo);
        sinfo.lpDesktop := PChar(VIRTUAL_DESKTOP);

        sFileName := ExtractFilePath(Application.EXEName) + 'c_IPU_Sender_Appl.exe';
        sFileName := sFileName +' '+ VIRTUAL_DESKTOP +' '+ Fs_LANUser;

        //Run the Message Sending Application on the new Desktop
        CreateProcess(nil,PChar(sFileName), nil, nil, False, 0, nil, nil, sinfo, pinfo);
        Fi_ProcessID := pinfo.dwProcessId;

        //Which to the new Desktop
        Desktop.SwitchToDesktop(VIRTUAL_DESKTOP);
        WaitForSingleObject(pinfo.hProcess, INFINITE);
    except
        on E: Exception do
            HandleError(E.Message);
    end;
  Mit Zitat antworten Zitat