控制Windows 7任务栏分组为我的应用 [英] control windows 7 taskbar grouping for my application

查看:129
本文介绍了控制Windows 7任务栏分组为我的应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的程序需要时,用户请求打开一系列信息的窗口,想实现某种自定义分组的Windows 7的任务栏上。



所需的功能:所有的我的信息窗口应该组合在一起(如果分组用户的系统上启用,这是),但我的主窗口,不应该与分组信息窗口。



我不能产卵我的信息窗口的新工艺。



我的思维过程是有可能修改信息窗口的窗口句柄莫名其妙地把它单独获得任务栏组的方式,但老实说,我甚至不知道从哪里开始这个问题。



修改



香港专业教育学院发现了一些新的信息。我可能能够做到与 SHGetPropertyStoreForWindow 的东西这里所说:的 http://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v = vs.85)的.aspx #where




...作为任何应用程序的运行Windows的属性。这可以以两种方式之一进行设置:
。如果由一个进程拥有不同的窗口需要不同AppUserModelIDs控制任务栏分组,使用SHGetPropertyStoreForWindow检索窗口的属性存储并设置AppUserModelID作为窗口属性



解决方案

我解决它使用的的Windows API代码包为.NET 和下面的代码:

  TaskbarManager.Instance.SetApplicationIdForSpecificWindow(窗口,GUID) 


My program needs to open a series of information windows when requested by a user, and would like to implement some kind of custom grouping on the windows 7 taskbar.

Desired functionality: All of my information windows should be grouped together (if grouping is enabled on the users system, that is) but my main window should NOT be grouped with the information windows.

I can not spawn a new process for my information windows.

My thought process is that there could be a way to modify the window handle of the information window somehow to get the taskbar to group it separately but I honestly don't even know where to start with this.

EDIT

Ive found some new information. I may be able to do something with SHGetPropertyStoreForWindow as stated here: http://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx#where

...As a property of any of the application's running windows. This can be set in one of two ways: If different windows owned by one process require different AppUserModelIDs to control taskbar grouping, use SHGetPropertyStoreForWindow to retrieve the window's property store and set the AppUserModelID as a window property.

解决方案

I solved it by using the Windows API Code Pack for .NET and the following code:

TaskbarManager.Instance.SetApplicationIdForSpecificWindow(window, guid);

这篇关于控制Windows 7任务栏分组为我的应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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