Adding threads to a process

  • Thread starter Thread starter Joe
  • Start date Start date
J

Joe

Basically, right now I'm trying to open up Adobe Acrobat
Reader from a Windows App but if one is already open an
execption is thrown so in order to get around this I check
if the process is already running and if so tell the user
to close the app. I should be able to just add another
thread to the process to overcome this right?

This is the current code I have for opening the app:

System.Diagnostics.Process myProcess = new
System.Diagnostics.Process();

myProcess.StartInfo.FileName = System.IO.Path.Combine
(System.IO.Path.GetTempPath(),
objSelectedDocument.DiskFileName);

myProcess.StartInfo.WindowStyle =
System.Diagnostics.ProcessWindowStyle.Maximized;

myProcess.Start();

Any help would be appreciated,

Joe
 
Joe said:
Basically, right now I'm trying to open up Adobe Acrobat
Reader from a Windows App but if one is already open an
execption is thrown so in order to get around this I check
if the process is already running and if so tell the user
to close the app. I should be able to just add another
thread to the process to overcome this right?

This is the current code I have for opening the app:

Any help would be appreciated,

Joe

Joe,

Why not just run the shell association for the pdf file? This will let you
run as many instances as you want.

System.Diagnostics.Process.Start(@"c:\docs\doc1.pdf");
System.Diagnostics.Process.Start(@"c:\docs\doc2.pdf");
System.Diagnostics.Process.Start(@"c:\docs\doc3.pdf");

Erik
 
Back
Top