是否可以在TaskManager应用程序选项卡中隐藏winform?

我正在编写一个透明的WinForms应用程序,我想隐藏应用程序在任务管理器的应用程序选项卡中显示。 我很好,它将在进程中显示(实际上它应该)。 如果我设置:

this.ShowInTaskbar = false; 

它只隐藏在任务栏中。

完整的代码,我有一个由标签制成的计时器

  public Form1() { InitializeComponent(); this.BackColor = Color.LimeGreen; this.TransparencyKey = Color.LimeGreen; Timer time = new Timer(); time.Interval = 1000; time.Tick += new EventHandler(time_Tick); time.Start(); this.ShowInTaskbar = false; } void time_Tick(object sender, EventArgs e) { label1_hour.Text = DateTime.Now.Hour.ToString() ; label_minute.Text = DateTime.Now.Minute.ToString(); label_second.Text = DateTime.Now.Second.ToString(); } 

尝试这样的事情

 public partial class Form1 : Form { public Form1() { InitializeComponent(); this.FormBorderStyle = FormBorderStyle.None; this.ShowInTaskbar = false; } protected override CreateParams CreateParams { get { var cp = base.CreateParams; cp.ExStyle |= 0x80; // Turn on WS_EX_TOOLWINDOW return cp; } } } 

简单地将表单属性FormBorderStyle设置为FixedToolWindow对我有用。 在Win 10上,它将它从任务管理器中的“应用程序”中删除,并将其放入OP指定的“后台进程”中……这也是我想要的。

此外,它删除了窗体显示在Windows的“Windows Key + Tab”列表中……这也是我想要的。