Creating an OS close button? (WinAPI)
I 开发者_开发知识库want to create a button that is basically Windows' close button. How could I do this? I want to avoid drawing this myself because I want it to look like that version of Windows' close button. Firefox's tabs do something like this. Thanks
You can get at Windows XP+ theme specific UI elements via the DrawThemeBackground
API.
Use WP_CLOSEBUTTON
for the window X button (and one of CBS_NORMAL/HOT/PUSHED/DISABLED
for its state) and you can draw one wherever you like.
The close buttons on the tabs in Firefox are part of its theme.
If you look in Program Files\Mozilla Firefox\chrome\ there's a zip file called classic.jar.
Inside this zip file is a png file skin\classic\global\icons\close.png.
This png file has the icons for the various states of the close buttons on the tabs:
from hg.mozilla.org
精彩评论