简体   繁体   中英

Custom titlebar icons - Vista / Windows7

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. Searching 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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