471,338 Members | 948 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Process.Start() blocking?

Hello NG,

I'm need to write some code which creates tiff files from various
document types (doc, pdf, xls). I want to do this by ShellExecuting
(via System.Diagnostics.Process) the doc-files with the "print"-verb.
This works for me. However, I need to handle the case when a printing
doesnt't quit in a given timespan (for example a password-protected
word-document). So I've tried the following:

1. I start the shell-exec vie Process.Start() (with "UseShellExec =
2. I start a thread which sleeps a give timespan and then checks
whether the shell-exec process is still alive.
3. If the shell-exec process is still alive it gets "killed".

In the case of one excel file, this approach wont work because the
Process.Start() function is blocking. This is what happens:
A call to Process.Start() "starts" the .xls. Excel opens, prints and
wants to quit. Before quitting, it displays a
The Process.Start() function won't return unless the Dialog gets closed
(manually). How can that be? I thought Process.Open() works asynchronly

(it does in all other case). I can't start the "killer-thread" bedore
calling Process.Start(), becuase the Process-object can't be used
before the Start()-method has returned.

Could anyone explain to me why Process.Start() behaves this way? Is
there any way to make my approach work?

Thanks in advance

Dec 16 '05 #1
0 2064

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Stephen.Haeney | last post: by
7 posts views Thread by Bob | last post: by
2 posts views Thread by jrm | last post: by
31 posts views Thread by Nikos Chantziaras | last post: by
12 posts views Thread by =?Utf-8?B?ZXAu?= | last post: by
reply views Thread by rosydwin | last post: by

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.