-1
var process = new Process
        {
            StartInfo = new ProcessStartInfo
            {
                FileName = @"C:\Program Files\CPUID\CPU-Z\cpuz.exe",
                UseShellExecute = false,
                RedirectStandardOutput = true,
                CreateNoWindow = true
            }
        };
       for(; ; )
        {
            process.Start();
            Thread.Sleep(20000);
            process.Kill();

        }

This program need to be hidden or even minimized? Can someone explain to me how to upgrade this?

  • 2
    Have you tried setting the property `ProcessStartInfo.WindowStyle` to `ProcessWindowState.Hidden` or `ProcessWindowState.Minimized`? – Danitechnik Feb 04 '21 at 09:56
  • You can look at this link https://stackoverflow.com/questions/3571627/show-hide-the-console-window-of-a-c-sharp-console-application#3571628 –  Feb 04 '21 at 09:58
  • @Danitechnik This is Console App btw –  Feb 04 '21 at 10:07
  • @GamerInTheGame This is Console App btw –  Feb 04 '21 at 10:07

1 Answers1

0

Add these lines to your code

this.ShowInTaskbar = false;
this.FormBorderStyle = FormBorderStyle.FixedToolWindow;