在WPF中打开窗口时的新任务栏图标 [英] New taskbar icon when opening a window in WPF

查看:78
本文介绍了在WPF中打开窗口时的新任务栏图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,该应用程序可以打开某些操作的另一个窗口.我为新窗口设置了一个单独的图标,新项目出现在任务栏中,但该项目堆叠在原始应用程序窗口的后面.是否可以在任务栏中显示未堆叠的新窗口?因此,我将在任务栏中有2个图标.

I have an application that opens another window on some action. I have set a separate icon for the new window, and a new item appears in the taskbar, but the item is stacked behind the original app window. Is it possible to show the new window unstacked in the task bar? So I would have 2 icons in the task bar.

请为我的问题查看图片.

Please see the image for my problem.

推荐答案

感谢Xaruth向我指出了正确的方向,我找到了答案.似乎寡妇使用 ApplicationID 来确定是否应将一个窗口与另一个窗口组合在一起.

Thanks to Xaruth for pointing me in the right direction I found the answer. It seems widows uses an ApplicationID to determine if a window should be grouped with another one.

如果下载Windows API代码包,则可以设置要显示为单独任务栏图标的窗口的 ApplicationID .

If you download the Windows API Code Pack you can set the ApplicationID of the window you want to appear as a separate taskbar icon.

代码如下:

TaskbarManager.Instance.SetApplicationIdForSpecificWindow(
    new WindowInteropHelper(wind).Handle, "Gx3OptimisationWindow");

您想在窗口中将风作为单独的图标,而 GX3OptimisationWindow 是新的 ApplicationID .

Where wind is the window you want as a separate icon and GX3OptimisationWindow is the new ApplicationID.

这篇关于在WPF中打开窗口时的新任务栏图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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