Window still visible

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Peter Morris

    Window still visible

    private void ExecuteCalculat ionEngine()
    {
    string executionPath = Path.GetDirecto ryName(InputFil eName);
    Directory.SetCu rrentDirectory( executionPath);
    var startInfo = new ProcessStartInf o(Path.Combine( executionPath,
    "xxxxxxxxx.exe" ));
    startInfo.Windo wStyle = ProcessWindowSt yle.Hidden;
    startInfo.Creat eNoWindow = true;
    startInfo.Worki ngDirectory = executionPath;
    Process.Start(s tartInfo).WaitF orExit();
    }

    Can anyone tell me why the window still appears?


    Thanks

    Pete

  • Family Tree Mike

    #2
    Re: Window still visible

    Did you write the executable being launched (xxxxxxx.exe)? If not, and it
    is a windows forms app, then perhaps the developer makes the form visible on
    startup. This worked for me from a forms app launching a forms app that I
    wrote, and did not forcibly make visible.

    Why did you declare startinfo as a var?

    "Peter Morris" <mrpmorrisNO@SP AMgmail.comwrot e in message
    news:O1dYvU3QJH A.1448@TK2MSFTN GP04.phx.gbl...
    private void ExecuteCalculat ionEngine()
    {
    string executionPath = Path.GetDirecto ryName(InputFil eName);
    Directory.SetCu rrentDirectory( executionPath);
    var startInfo = new ProcessStartInf o(Path.Combine( executionPath,
    "xxxxxxxxx.exe" ));
    startInfo.Windo wStyle = ProcessWindowSt yle.Hidden;
    startInfo.Creat eNoWindow = true;
    startInfo.Worki ngDirectory = executionPath;
    Process.Start(s tartInfo).WaitF orExit();
    }
    >
    Can anyone tell me why the window still appears?
    >
    >
    Thanks
    >
    Pete

    Comment

    • Peter Morris

      #3
      Re: Window still visible

      Hi Mike
      Did you write the executable being launched (xxxxxxx.exe)?
      No, I didn't.
      If not, and it is a windows forms app, then perhaps the developer makes
      the form visible on startup.
      That is very possible. Does anyone know how I can iterate forms owned by a
      process and then hide them?

      Why did you declare startinfo as a var?
      I suspect this is a path of discussion I don't have time for :-)



      --
      Pete
      ====




      Comment

      Working...