New taskbar icon when opening a window in WPF

梦想的初衷 提交于 2020-01-03 09:11:31

问题


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.


回答1:


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.

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.

Heres the code -

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

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




回答2:


This is Windows option. You can do this by

  1. Right click on Taskbar ----> Properties
  2. In Properties window Select Taskbar tab
  3. Select "Never Combine" from TaskBar combobox.
  4. Click Apply


来源:https://stackoverflow.com/questions/18337717/new-taskbar-icon-when-opening-a-window-in-wpf

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!