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. 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. 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!
Asked
Active
Viewed 9,903 times
9

Anton Semenov
- 6,227
- 5
- 41
- 69
-
I think all the title bar button might be Custom one – anishMarokey Apr 06 '11 at 18:19
-
@anishMarokey. Yes I have the same supposition, but how to achive such glowing? – Anton Semenov Apr 06 '11 at 18:20
2 Answers
4
In Vista and Windows 7 there is a new thing called the Desktop Window Manager. This is used to draw the "Aero glass" window titlebars, and do the glow effects. 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.
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:

Alireza Noori
- 14,961
- 30
- 95
- 179

Jason Williams
- 56,972
- 11
- 108
- 137
-
Your third link points to this question, so I guess it won't be very helpful ;) – Thomas Levesque Apr 06 '11 at 22:36
-
Yes, third link brings dead loop in this question :) Any way thank you for answer, I will explore all links carefully – Anton Semenov Apr 07 '11 at 07:19
-
1Sorry, I copied from a different page, but must have lost the URL in translation. (Although there's a really great answer on the question I linked to :-) – Jason Williams Apr 08 '11 at 06:07
-
It may have been this one: http://stackoverflow.com/questions/2308853/custom-draw-aero-title-bar-without-extending-into-client-area – Jason Williams Apr 08 '11 at 06:14
-
1Thank you, Jason! As it turned out Desktop Window Manager is stright I was looking for – Anton Semenov Apr 09 '11 at 19:15
1
Yes, this can be (and undoubtedly is) done by hooking WM_NCPAINT and painting their button in response to it. 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).

Jerry Coffin
- 476,176
- 80
- 629
- 1,111
-
Wow! Thank you, Jerry, for your answer! Can you advice me a way I can learn more about shading such things? – Anton Semenov Apr 06 '11 at 18:29
-
@Anton: I'd guess most small things like this are done by hand in something like Photoshop. The topical alternative would be to create a 3D model of the curved front for the button, render it in something like DirectX or OpenGL, and capture what that creates and use it as an bitmap to draw your button. – Jerry Coffin Apr 06 '11 at 18:34