Non client painting on aero glass window

Deadly 提交于 2019-12-17 06:27:07

问题


Now Im customizing title bar of my application. My aim is to add one extra button on title bar. Im my previous question people have adviced me the way I can customize non client area. Thats works perfectly except one small thing - glowing! I can draw glowing in nonclient area but I cannot make it spreads out of the window. I also cant find any resource about this subj.

I looked into this sample and made my own test app for investigating non client drawing facilities. Screen shot of my app's window:

So you can see that system button glows out of the windows when my is clipped by borderframe.

For example, Skype's window have four custom buttons in title bar and they can "glow" out of the window frame:

Can anybody advise me to find out the way to draw button's glowing out of the window?
Thanks in advance!

[EDIT]
Thank you everybody for answers!


回答1:


Skype cheats it, and has a little sliver along the top of their window; where they can draw it.

You can see it with Process Explorer to SpyXX:

See also

MSDN: Custom Window Frame Using DWM




回答2:


I don't think it's possible to draw beyond your NC area, and I kind of doubt they are drawing the whole UI to exactly match DWM Aero effects.

Given how this looks, I wonder if they did some tricks with either the help or restore button of a CustomBorderForm, which would then get the DWM blur highlight effect "for free".

Here's the most relevant article I could find to this: http://geekswithblogs.net/kobush/articles/CustomBorderForms3.aspx

Followup - I think this custom chrome thread has more pointers to the same techniques (although different goal): Custom titlebars/chrome in a WinForms app




回答3:


AFAIK, this is not possible, because the area outside your window's border simply does not belong to you.

The Skype screenshot is from a custom-drawn frame that most likely extends a bit beyond the visible borders, not from an Aero Glass frame. You can tell the difference if you look carefully.



来源:https://stackoverflow.com/questions/5634743/non-client-painting-on-aero-glass-window

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