0

I am trying to run explorer.exe using Process.start(ProcessInfo); function and then wait for the process to terminate itself and then perfom some action on the exit of the process. here is the code snippest

ProcessStartInfo StartInfo = new ProcessStartInfo();
StartInfo.FileName = "\\SDMMC\\explorer.exe";
StartInfo.UseShellExecute = false;
StartInfo.Arguments = null;
Process NewProcess = Process.Start(StartInfo);
NewProcess.WaitForExit();
NewProcess.EnableRaisingEvents = true;
NewProcess.Exited += new EventHandler(NewProcess_Exited);
MessageBox.Show("ExitCode finished");

but explorer.exe is still running and on the other hand NewProcess.HasExited is true, Please help how can I make the program wait for explorer.exe to terminate and then perfom any action. thanks

Innayat
  • 11
  • 3

1 Answers1

0

Typically explorer.exe doesn't exit. Also if explorer is running, attempting to launch another instance only launches a windows explorer window. From your snippet it looks like you are launching a custom explorer. I've worked with customizing the HPC explorer that is provided with Windows CE, and I've not been successful at getting it to gracefully exit. I'll need more details about what you are trying to accomplish to offer any other suggestions.

Damon8or
  • 527
  • 2
  • 11