简体   繁体   English

如何在Windows任务栏中创建文本框?

[英]How to make a textbox in the windows taskbar?

I am making an application which will take a search query from the user and display the results. 我正在制作一个应用程序,它将从用户那里获取搜索查询并显示结果。 To make the interface more user friendly, I thought of making a textbox in the taskbar which accepts input and then displays the results in a new window. 为了使界面更加用户友好,我想在任务栏中创建一个接受输入的文本框,然后在新窗口中显示结果。 I have looked into the links of the same question both on SO as well as other sites. 我已经在SO以及其他网站上查看过相同问题的链接。
Based on what I have found out by using google and other sites that we need to use Bands to achieve this thing. 基于我通过谷歌和其他网站发现我们需要使用Bands来实现这一点。
Can somebody please explain me the solution to the above problem(Bands), you can point out any good links or some articles also, or you can write a code sample to explain. 有人可以解释一下上面问题的解决方案(Bands),你也可以指出任何好的链接或者一些文章,或者你可以写一个代码示例来解释。 I just want enough information to get me started on the solution to this problem. 我只是想要足够的信息让我开始解决这个问题。

"You should use thumbnail toolbars in new development in place of desk bands, which are not supported as of Windows 7." “你应该在新的开发中使用缩略图工具栏代替桌面乐队,从Windows 7开始不支持。” - MSDN - MSDN

Unfortunately, it appears that Microsoft is discouraging the creation of in-taskbar GUIs like what you're talking about. 不幸的是,似乎微软正在劝阻像你所说的那样创建任务栏GUI。 The alternative option is to use taskbar extensions, as discussed here . 替代方案是使用任务栏扩展,讨论在这里 MSDN does appear to give some contradictory information on the taskbar extension page, directing developers to the IDeskBand2 page (where the quote at top is from). MSDN确实在任务栏扩展页面上提供了一些相互矛盾的信息,将开发人员引导到IDeskBand2页面(顶部的引用来自)。 For future compatibility, I'd still recommend against it. 为了将来的兼容性,我仍然建议不要使用它。

If you're dead set on it, or you're only targeting xp (or vista) for some reason, the following might be helpful: 如果您已经设置了它,或者您出于某种原因仅针对xp(或vista),则以下内容可能会有所帮助:

Although they can be used much like normal windows, band objects are COM objects that exist within a container. 尽管它们可以像普通窗口一样使用,但是band对象是容器中存在的COM对象。 Explorer Bars are contained by Internet Explorer, and desk bands are contained by the Shell. 浏览器栏包含在Internet Explorer中,桌面栏包含在Shell中。 While they serve different functions, their basic implementation is very similar. 虽然它们提供不同的功能,但它们的基本实现非常相似。 The primary difference is in how the band object is registered, which in turn controls the type of object and its container. 主要区别在于如何注册band对象,而对象又控制对象及其容器的类型。 This section discusses those aspects of implementation that are common to all band objects. 本节讨论所有band对象共有的实现方面。 See A Simple Example of a Custom Explorer Bar for additional implementation details. 有关其他实现详细信息,请参阅自定义浏览器栏的简单示例。 In addition to IUnknown and IClassFactory, all band objects must implement the following interfaces: 除了IUnknown和IClassFactory之外,所有band对象都必须实现以下接口:
- IDeskBand - IDeskBand
- IObjectWithSite - IObjectWithSite
- IPersistStream - IPersistStream

In addition to registering their class identifier (CLSID), the Explorer Bar and desk band objects must also be registered for the appropriate component category. 除了注册其类标识符(CLSID)之外,还必须为相应的组件类别注册Explorer Bar和桌面带对象。 Registering the component category determines the object type and its container. 注册组件类别可确定对象类型及其容器。 Tool bands use a different registration procedure and do not have a category identifier (CATID). 工具带使用不同的注册过程,并且没有类别标识符(CATID)。 The CATIDs for the three band objects that require them are: 需要它们的三个波段对象的CATID是:
- Band Type: Component Category - 波段类型:组件类别
- Vertical Explorer Bar: CATID_InfoBand - 垂直浏览器栏:CATID_InfoBand
- Horizontal Explorer Bar: CATID_CommBand - 水平浏览器栏:CATID_CommBand
- Desk Band: CATID_DeskBand - 桌面乐队:CATID_DeskBand

Just about everything you'd need to know can be found here 几乎所有你需要知道的东西都可以在这里找到

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM