如何改变一个Win32 API应用程序的控制主题? [英] How to change the control themes in a Win32 API application?

查看:185
本文介绍了如何改变一个Win32 API应用程序的控制主题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我在Win32 API中创建一个按钮,默认conrol主题看起来像一个Windows 95/98的按钮。我记得在过去的微软论坛上告诉我如何让XP的风格,但我不记得如何做到这一点。有没有一种方法以编程方式或手动更改控制主题的Win32应用程序?谢谢你。

If I create a button in the Win32 API, the default conrol theme looks like a Windows 95/98 button. I remember in the past the Microsoft forums told me how to get the XP style, but I don't recall how to do this. Is there a way to programatically or manually change the control themes in a Win32 application? Thanks.

推荐答案

您想要的启用通过添加一个清单依赖于共同控制6组​​装到您的应用程序清单。

You want to Enable Visual Styles by adding a manifest dependency to the common control 6 assembly to your applications manifest.

如果您使用DevStudio的它应该是简单,只要从链接页面添加#pragma指令:

If you use DevStudio it should be as simple as adding the #pragma directive from the linked page:

#pragma comment(linker,"\"/manifestdependency:type='win32'        
                name='Microsoft.Windows.Common-Controls'
                version='6.0.0.0' processorArchitecture='*'
                publicKeyToken='6595b64144ccf1df' language='*'\"")

这篇关于如何改变一个Win32 API应用程序的控制主题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆