c# - Process.Exited only fires when using Windows Applications -
i have been trying solve few days, program starts process (gui application such notepad or (metro) images) this:
system.diagnostics.process execute = new system.diagnostics.process(); execute.startinfo.filename = (system.io.path.gettemppath() + @"{nr6t7yhygfdgy77fm74766jtf63ij78899dv884}\" + system.io.path.getfilenamewithoutextension(app.args[1])); execute.enableraisingevents = true; execute.exited += delegate { file.delete(system.io.path.gettemppath() + @"{nr6t7yhygfdgy77fm74766jtf63ij78899dv884}\" + system.io.path.getfilenamewithoutextension(app.args[1])); app.current.shutdown(); }; execute.start();
then calls this.hide()
become equivalent of background process. problem is, if open file opens word, photos(metro) or other app can uninstalled execute.exited never fires. if open file opens notepad, paint or other app can't uninstalled execute.exited does fire.. have been able rule out potential problems:
- since
execute.enableraisingevents = true;
process raising events. - nothing blocking code unlike this
- i have tried using
process.waitforexit();
doesn't work either
please guys.
Comments
Post a Comment