开发者

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:

Creating an OS close button? (WinAPI)

from hg.mozilla.org

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜