A
A
Alexey Zenkov2014-07-11 11:11:49
.NET
Alexey Zenkov, 2014-07-11 11:11:49

How to hide external application windows when called from c# code?

There is a code (we call wget for Windows) - despite UseShellExecute = false, the terminal window is still drawn, and since this function is called by a mountain of threads ...
tell me how not to draw the window of an external application?

Process wget = new Process();
            wget.StartInfo.FileName = @"C:\Program Files (x86)\GnuWin32\bin\wget.exe";
            wget.StartInfo.WorkingDirectory = @".\temp";
            wget.StartInfo.Arguments = "--no-check-certificate " + url.AbsoluteUri;
            wget.StartInfo.RedirectStandardOutput = true;
            wget.StartInfo.RedirectStandardInput = true;
            wget.StartInfo.RedirectStandardError = true;
            wget.StartInfo.UseShellExecute = false;
            wget.Start();

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Zenkov, 2014-07-11
@Lexxus31337

Everything ingenious is simple as usual)
wget.StartInfo.CreateNoWindow = true;

A
art090390, 2014-07-11
@art090390

it is possible to set this
msdn.microsoft.com/en-us/library/system.diagnostic...
to Hidden

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question