473,326 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Adding threads to a process

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
Nov 15 '05 #1
2 1344
"Joe" <an*******@discussions.microsoft.com> wrote in message
news:38****************************@phx.gbl...
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:
<snip>
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.pd f");
System.Diagnostics.Process.Start(@"c:\docs\doc2.pd f");
System.Diagnostics.Process.Start(@"c:\docs\doc3.pd f");

Erik
Nov 15 '05 #2
Joe
Thanks man :)
Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Gonçalo Rodrigues | last post by:
Hi, I have a problem with threads and sockets. I'll try to describe the problem in words with pseudo-code. I've been working on a few classes to make it easier to work with threads. This...
6
by: m | last post by:
Hello, I have an application that processes thousands of files each day. The filenames and various related file information is retrieved, related filenames are associate and placed in a linked...
3
by: bygandhi | last post by:
Hi - I am writing a service which will check a process and its threads for their state ( alive or dead ). The process has 5 .net managed threads created using thread.start and each have been...
3
by: mareal | last post by:
I am using the System.Diagnostics.Process class in order to loop thru all the processes running. Within that loop I am looking for the process name “aspnet_wp” in order to get the process ID....
10
by: Darian | last post by:
Is there a way to find all the thread names that are running in a project? For example, if I have 5 threads T1, T2, T3, T4, T5...and T2, T4, and T5 are running...I want to be able to know that...
5
by: shumaker | last post by:
I just read an overview of C# 3.0, and it occured to me that some of these features could make it much easier to write programs that automatically make use of multi core processors. After reading...
3
by: Jerry Spence1 | last post by:
How can I gain access to all the threads running in my application? I'm looking for something like: Application.Threads.count Application.threads(item).IsAlive Application.threads(item).Name ...
3
by: tshad | last post by:
I need to find out how many threads a process has. I have used ThreadPool.GetAvailableThreads and ThreadPool.GetMaxThreads, but they both show 50 for worker threads and 100 for port threads. ...
4
by: tdahsu | last post by:
All, I'd appreciate any help. I've got a list of files in a directory, and I'd like to iterate through that list and process each one. Rather than do that serially, I was thinking I should...
167
by: darren | last post by:
Hi I have to write a multi-threaded program. I decided to take an OO approach to it. I had the idea to wrap up all of the thread functions in a mix-in class called Threadable. Then when an...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.