using process class

M

Michael Smith

Hi,
I am using the following code to print documents directly
to the default printer
**************
ProcessStartInfo startInfo = new ProcessStartInfo
("<someprogram>.exe");
startInfo.WindowStyle = ProcessWindowStyle.Minimized;
startInfo.FileName = filename;
startInfo.Verb = "Print";
Process.Start(startInfo);
**************
the code successfully launches and prints the program,
but the window is not always minimized. I did a few
tests and found out that the window will only minimize if
I manually quit the launched program after each
execution. If the program is left running, or if it is
already running, the window will not be minimized. The
same is true for ProcessWindowStyle.Hidden. is there a
way to make the window stay minimized/hidden all the
time?

Also, certain programs only print the first page (i.e.
Windows Journal). Is there a way to send these programs
the message to pring all pages? or do I have to find
another way to print them?
Thank you in advance.
-michael
 
M

Michael_Smith

It still does not work when the application is already
running.
I did
....
Process process = new Process();
ProcessStartInfo startInfo = new ProcessStartInfo
("WINWORD.EXE");
process.StartInfo = startInfo;
startInfo.WindowStyle = ProcessWindowStyle.Minimized;
process.Start();
 
M

Michael Smith

It still does not work when the application is already
running.
I did
.....
Process process = new Process();
ProcessStartInfo startInfo = new ProcessStartInfo
("WINWORD.EXE");
process.StartInfo = startInfo;
process.StartInfo.WindowStyle =
ProcessWindowStyle.Minimized;
process.Start();
 

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