using process class

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Michael Smith

    #1

    using process class

    Hi,
    I am using the following code to print documents directly
    to the default printer
    **************
    ProcessStartInf o startInfo = new ProcessStartInf o
    ("<someprogram> .exe");
    startInfo.Windo wStyle = ProcessWindowSt yle.Minimized;
    startInfo.FileN ame = filename;
    startInfo.Verb = "Print";
    Process.Start(s tartInfo);
    **************
    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 ProcessWindowSt yle.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
  • Michael_Smith

    #2
    using process class

    It still does not work when the application is already
    running.
    I did
    ....
    Process process = new Process();
    ProcessStartInf o startInfo = new ProcessStartInf o
    ("WINWORD.EXE") ;
    process.StartIn fo = startInfo;
    startInfo.Windo wStyle = ProcessWindowSt yle.Minimized;
    process.Start() ;
    [color=blue]
    >-----Original Message-----
    >To solve this do the following.
    >....
    >myProcess.Star tInfo = myStartInfo
    >myProcess.Star tInfo.WindowSty le=ProcessWindo wStyle.Minimi[/color]
    ze[color=blue]
    >d;
    >myProcess.Star t()
    >
    >Hope this helps,
    >[color=green]
    >>-----Original Message-----
    >>Hi,
    >>I am using the following code to print documents[/color][/color]
    directly[color=blue][color=green]
    >>to the default printer
    >>************* *
    >>ProcessStartI nfo startInfo = new ProcessStartInf o
    >>("<someprogra m>.exe");
    >>startInfo.Win dowStyle = ProcessWindowSt yle.Minimized;
    >>startInfo.Fil eName = filename;
    >>startInfo.Ver b = "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[/color][/color]
    if[color=blue][color=green]
    >>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 ProcessWindowSt yle.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[/color][/color]
    programs[color=blue][color=green]
    >>the message to pring all pages? or do I have to find
    >>another way to print them?
    >>Thank you in advance.
    >>-michael
    >>.
    >>[/color]
    >.
    >[/color]

    Comment

    • Michael Smith

      #3
      *using process class

      It still does not work when the application is already
      running.
      I did
      .....
      Process process = new Process();
      ProcessStartInf o startInfo = new ProcessStartInf o
      ("WINWORD.EXE") ;
      process.StartIn fo = startInfo;
      process.StartIn fo.WindowStyle =
      ProcessWindowSt yle.Minimized;
      process.Start() ;

      [color=blue]
      >-----Original Message-----
      >To solve this do the following.
      >....
      >myProcess.Star tInfo = myStartInfo
      >myProcess.Star tInfo.WindowSty le=ProcessWindo wStyle.Minimi[/color]
      ze[color=blue]
      >d;
      >myProcess.Star t()
      >
      >Hope this helps,
      >[color=green]
      >>-----Original Message-----
      >>Hi,
      >>I am using the following code to print documents[/color][/color]
      directly[color=blue][color=green]
      >>to the default printer
      >>************* *
      >>ProcessStartI nfo startInfo = new ProcessStartInf o
      >>("<someprogra m>.exe");
      >>startInfo.Win dowStyle = ProcessWindowSt yle.Minimized;
      >>startInfo.Fil eName = filename;
      >>startInfo.Ver b = "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[/color][/color]
      if[color=blue][color=green]
      >>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 ProcessWindowSt yle.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[/color][/color]
      programs[color=blue][color=green]
      >>the message to pring all pages? or do I have to find
      >>another way to print them?
      >>Thank you in advance.
      >>-michael
      >>.
      >>[/color]
      >.
      >[/color]

      Comment

      Working...