sheshant / pdf2image

Automatically exported from code.google.com/p/pdf2image
0 stars 0 forks source link

Get gswin32.exe ProcessID #19

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi, I'm running pdf2image.exe via C# code

using (Process p = new Process())
{
   p.StartInfo.FileName = "C:\\pdf2image\\pdf2image.exe";
   p.StartInfo.WorkingDirectory = "C:\\pdf2image";
   p.StartInfo.Arguments = some_args
   p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
   p.StartInfo.CreateNoWindow = true;
   p.StartInfo.UseShellExecute = false;
   p.StartInfo.RedirectStandardOutput = true;
   p.StartInfo.RedirectStandardError = true;
   p.StartInfo.UseShellExecute = false;

   p.Start();

   result.OutputMsg = p.StandardOutput.ReadToEnd();
   result.ErrorMsg = p.StandardError.ReadToEnd();

   p.WaitForExit();
}

I see that process creates another named gswin32.exe. Sometimes I need to kill 
the pdf2image process which works, but also I need to kill the gswin32 process 
but pdf2image doesn't give the posibility to get the gswin32 Process ID which 
it creates.

I cannot just kill all process with 'gswin32' name, because sometimes I create 
many pdf2image processes at one time, so I must know which gswin32 process 
belongs to which pdf2image process.

Any help ?

Original issue reported on code.google.com by slynn...@gmail.com on 16 Dec 2013 at 5:29