在标题栏,但不是在任务栏中隐藏图标是在、但不、栏中、图标

2023-09-04 01:22:06 作者:耍酷是爷的资本

我有我想要在任务栏显示图标;不过,我不想要这个图标,在标题栏中显示。我试着设置 ShowIcon 来假的,但在这两个标题栏,任务栏隐藏我的图标。有没有什么办法可以只隐藏标题栏?

I have an icon that I want to display in the taskbar; however, I don't want this icon to display in the title bar. I tried setting ShowIcon to false, but that hides my icon in both the title bar and the task bar. Is there any way to only hide it in the title bar?

推荐答案

根据里兹差我来评论他的答案的链接,这是我使用的解决方案:

Based on the link Riz sent me in a comment to his answer, this was the solution I used:

using(Bitmap emptyImage = new Bitmap(1, 1))
    Native.SendMessage(this.Handle, Native.WM_SETICON, Native.ICON_SMALL, emptyImage.GetHicon());