简体   繁体   English

如何在窗口标题栏中添加一个额外的按钮,这样它将作为标准工作?

[英]How to add an extra button to the window title bar, so it will be work as standard?

Firstly I want mention that I have already read all articles on SO on subject, but still have no answer for my question. 首先,我想提一下,我已经阅读了关于主题的所有文章,但仍然没有回答我的问题。 Also my question slightly different than others. 我的问题也与其他人略有不同。
Today a I have a look on Skype window. 今天我来看一下Skype窗口。 There is one extra button on it's title bar. 标题栏上有一个额外的按钮。 But this button acts as native system button. 但是此按钮充当本机系统按钮。 Just look on glowing, it spreads out of the window . 只要看着发光, 就会从窗户传播开来 So I have the reasonable question. 所以我有一个合理的问题。 According to that we can see on the picture below, there is standard way to add extra button on title bar. 根据我们可以在下面的图片中看到,有标准方法在标题栏上添加额外的按钮。 But all answers on subj leads to hooking of WM_NCPAINT event and manual drawing of extra button. 但是WM_NCPAINT上的所有答案都会导致挂钩WM_NCPAINT事件和手动绘制额外按钮。 This approach is work but it could not yield such beautifull glowing as on the picture. 这种方法很有效,但它无法像图片那样产生如此美丽的光芒。
Does anybody knows the way to add standartized button on window's title bar? 有人知道在窗口标题栏上添加标准化按钮的方法吗? Thanks in advance! 提前致谢!
在此输入图像描述

In Vista and Windows 7 there is a new thing called the Desktop Window Manager. 在Vista和Windows 7中有一个叫做桌面窗口管理器的新东西。 This is used to draw the "Aero glass" window titlebars, and do the glow effects. 这用于绘制“Aero glass”窗口标题栏,并执行发光效果。 The old Windows XP approach of implementing WM_NCPAINT handlers doesn't work with this new system, so you have to use a whole new API. 实现WM_NCPAINT处理程序的旧Windows XP方法不适用于这个新系统,因此您必须使用全新的API。

I'm sure I've seen some articles on doing what you're asking about, but can't find them right now. 我确信我已经看过一些关于做你所询问的文章,但现在找不到它们。 Some pages that might give you some leads are: 一些可能会给你一些线索的网页是:

Yes, this can be (and undoubtedly is ) done by hooking WM_NCPAINT and painting their button in response to it. 是的,这可以(并且无疑 )通过挂钩WM_NCPAINT并绘制它们的按钮来响应它。 The "glowing" is just a matter of picking the appropriate color and shading (and possibly doing a bit of alpha blending to have some "glow" show up close to the button). “发光”只是选择适当的颜色和阴影(并且可能进行一些alpha混合以使某些“发光”显示在靠近按钮的位置)。

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

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