0

On Windows 10, Task Manager separates running processes into 3 different categories: Apps, Background Processes and Windows Processes. When I compile and run my C# executable, it's located under Apps section in the Task Manager. However, I want to run it under Background Processes section.

I tried to use this.ShowInTaskbar = false; but it's not working on Windows 10.

Robert Zunr
  • 67
  • 1
  • 11

1 Answers1

1

The difference between a background process and an app, in the eyes of the task manager, is that the latter has at least one visible window, and the former does not. So, make sure that you don't have any visible windows and your process will be placed in the background process category.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • I tried to use invisible window via setting opacity to 0, but no luck. Do you have any other suggestions? – Robert Zunr Mar 06 '19 at 11:27
  • 1
    That's not an invisible window. Not sure what GUI framework you are using, or how many windows you have, so can't tell you the precise code you need. But it's usually something like `form.Visible = false` although it's probably more complex if you are using WPF – David Heffernan Mar 06 '19 at 11:30
  • 1
    Of course, the other thing you could do is not create a window at all. – David Heffernan Mar 06 '19 at 11:35
  • 1
    In WPF it's going to be `form.Visibility = Visibility.Hidden`, which you can of course set at design time – David Heffernan Mar 06 '19 at 11:39
  • I get "Form does not contain a definition for 'Visibility'" error. – Robert Zunr Mar 06 '19 at 11:43
  • 2
    I guess you aren't using WPF then are you? I don't really want to try to guess what UI framework you are using. That's no fun. Surely you know. In any case, if you want a background app, why are you even creating a window? – David Heffernan Mar 06 '19 at 12:24