By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,672 Members | 1,304 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,672 IT Pros & Developers. It's quick & easy.

using process class

P: n/a
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
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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();
-----Original Message-----
To solve this do the following.
....
myProcess.StartInfo = myStartInfo
myProcess.StartInfo.WindowStyle=ProcessWindowStyl e.Minimi zed;
myProcess.Start()

Hope this helps,
-----Original Message-----
Hi,
I am using the following code to print documents directlyto 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 ifI 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 programsthe message to pring all pages? or do I have to find
another way to print them?
Thank you in advance.
-michael
.

.

Nov 13 '05 #2

P: n/a
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();

-----Original Message-----
To solve this do the following.
....
myProcess.StartInfo = myStartInfo
myProcess.StartInfo.WindowStyle=ProcessWindowStyl e.Minimi zed;
myProcess.Start()

Hope this helps,
-----Original Message-----
Hi,
I am using the following code to print documents directlyto 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 ifI 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 programsthe message to pring all pages? or do I have to find
another way to print them?
Thank you in advance.
-michael
.

.

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.