是否有可能隐藏的winform在任务管理器的应用程序选项卡? [英] Is it possible to hide winform in TaskManager application tab?

查看:213
本文介绍了是否有可能隐藏的winform在任务管理器的应用程序选项卡?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在写一个透明的WinForms应用程序,我想从显示在任务管理器的应用程序选项卡中隐藏的应用程序。我与事实确认,将在进程显示(其实它应该)。 如果我设置:

  this.ShowInTaskbar = FALSE;
 

它只是隐藏任务栏。

全部codeI有我也有一个计时器从标签制作

 公共Form1中()
    {
        的InitializeComponent();
        this.BackColor = Color.LimeGreen;
        this.TransparencyKey = Color.LimeGreen;
        定时时间=新的Timer();
        time.Interval = 1000;
        time.Tick + =新的EventHandler(time_Tick);
        time.Start();
        this.ShowInTaskbar = FALSE;


    }

    无效time_Tick(对象发件人,EventArgs的)
    {
        label1_hour.Text = DateTime.Now.Hour.ToString();
        label_minute.Text = DateTime.Now.Minute.ToString();
        label_second.Text = DateTime.Now.Second.ToString();
    }
 

解决方案

尝试像这样

 公共部分Form1类:表格{
    公共Form1中(){
        的InitializeComponent();
        this.FormBorderStyle = FormBorderStyle.None;
        this.ShowInTaskbar = FALSE;
    }
    保护覆盖的CreateParams的CreateParams {
        得到 {
            变种CP = base.CreateParams;
            cp.ExStyle | = 0x80的; //开启WS_EX_TOOLWINDOW
            返回CP;
        }
    }
}
 

I'm writing a transparent WinForms app and I want to hide the app from showing in Task Manager's applications tab. I'm OK with the fact that it will show in Processes (in fact it should). If I set:

this.ShowInTaskbar = false;

it only hides from taskbar.

Full code i have i have a timer made from labels

        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();
    }

解决方案

Try something like this

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;
        }
    }
}

这篇关于是否有可能隐藏的winform在任务管理器的应用程序选项卡?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆