Adding threads to a process

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
 
E

Erik Frey

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top