开发者

Custom titlebar icons - Vista / Windows7

开发者 https://www.devze.com 2023-01-05 18:30 出处:网络
I\'d like to add a custom button to my Window\'s titlebar.This doesn\'t need to work on XP - just Vista and later.Searchin开发者_如何学Gog on the net yields lots of results for doing it the WM_NCPAINT

I'd like to add a custom button to my Window's titlebar. This doesn't need to work on XP - just Vista and later. Searchin开发者_如何学Gog on the net yields lots of results for doing it the WM_NCPAINT way (eg. http://www.catch22.net/tuts/custom-titlebar). Is there a way to do this using Vista/Windows7 with Aero is enabled?

Thanks for any help, Dan.


There is no simple way to do this, even on Vista/7. If you don't want to use the WM_NC* method, you can create your window without the WS_CAPTION, WS_SYSMENU, etc. styles, use DwmExtendFrameIntoClientArea to make a portion of your client area into the window frame, and then draw the titlebar yourself. However, this isn't less work than using the MC_NC* method because you will need to implement all of the titlebar features (system menu, close box, maximize box, etc.) yourself.

0

精彩评论

暂无评论...
验证码 换一张
取 消