简体   繁体   English

如何为Win32应用程序设置外观

[英]How to Skin an Win32 Application

Win32 look nasty, how to make it look better by custom skins? Win32看起来很讨厌,如何通过自定义皮肤让它看起来更好看?

I mean something like Adobe products, iTunes, Autodesk 3dsmax and Softimage XSI, Windows media player, Blender, Comodo firewall, Winamp, Babylon client, and few download managers etc. ; 我的意思是像Adobe产品,iTunes,Autodesk 3dsmax和Softimage XSI,Windows媒体播放器,Blender,Comodo防火墙,Winamp,Babylon客户端以及少数下载管理器等

there are many similar applications out there but I can't find any proper tutorial or guideline, it looks like secret recipe! 有很多类似的应用程序,但我找不到任何适当的教程或指南,它看起来像秘方!

only -two- tutorials available online: 只有两个在线提供的教程:

old and useless: http://www.codeproject.com/Articles/20497/Draw-Skin-Window-Using-Pure-Win32-API 老而无用: http//www.codeproject.com/Articles/20497/Draw-Skin-Window-Using-Pure-Win32-API

only cover opaque background (and this is what I avoid, I need more about GUI components): http://www.flipcode.com/archives/Win32_Window_Skinning.shtml 只覆盖不透明的背景(这是我避免的,我需要更多关于GUI组件): http//www.flipcode.com/archives/Win32_Window_Skinning.shtml

Is there any book or proper guideline to learn how to build skins for Win32api? 是否有任何书籍或适当的指南来学习如何为Win32api构建皮肤?

Edit: I accept David Rodríguez comment, down there ↓↓ 编辑:我接受大卫罗德里格斯评论,那里↓↓

I have done this before using C++ Builder. 我在使用C ++ Builder之前已经这样做了。 The approach I took was to create a form, set it to be borderless and color the entire form the same color. 我采用的方法是创建一个表单,将其设置为无边框,并将整个表单的颜色设置为相同的颜色。 Then I set the form transparency to this color. 然后我将表单透明度设置为此颜色。 I then add images to the form which create the desired skin. 然后我将图像添加到创建所需皮肤的表单中。

I'm sure this can all be done through standard win APIs, but I can't describe (or advise) doing it solely through API calls. 我确信这一切都可以通过标准的win API完成,但我无法通过API调用来描述(或建议)。

If you are not afraid to learn how to use low level SDK programming, then try this link: Take control of your window code 如果您不想学习如何使用低级SDK编程,请尝试以下链接: 控制您的窗口代码

Also do a Google search for WinLIFT. 还可以在Google上搜索WinLIFT。

The operating system handles "skinning" for you automatically. 操作系统会自动为您处理“换肤”。

In "classic" mode (or Windows 2000 and earlier versions), this gets you a, well classic-looking interface. 在“经典”模式(或Windows 2000及更早版本)中,这将为您提供一个非常经典的界面。 The windows are drawn just like they always were since Windows 95. Presumably, this is what you are referring to when you say that "Win32 look nasty". 窗口就像它们自Windows 95以来一样被绘制。据推测,当你说“Win32看起来很讨厌”时,这就是你所指的。 However, you need to realize that many people like this look and specifically choose to enable it on their machines. 但是,您需要意识到很多人都喜欢这种外观并且特别选择在他们的机器上启用它。 [WARNING: Personal opinion coming up!] I'm one of those people, and judging from the screenshots that get posted here from developers' machines, I'm definitely not the only one. [警告:个人意见即将出现!]我是其中一个人,从开发人员机器上发布的屏幕截图来看,我绝对不是唯一一个。

Windows XP actually introducing the "skinning" or theming engine, which lives in a set of Windows DLLs. Windows XP实际上引入了“皮肤”或主题引擎,它们存在于一组Windows DLL中。 By explicitly linking to version 6 of ComCtl32.dll , your application would automatically get these visual effects. 通过显式链接到ComCtl32.dll的版本6 ,您的应用程序将自动获得这些视觉效果。 Some people said this version of Windows looked "Fisher-Price" , while others were perfectly happy with the term "gaudy". 有人说这个版本的Windows看起来像“Fisher-Price” ,而其他人则对“艳俗”一词非常满意。 The option was retained to allow the user to switch to the "classic" theme (as described above), if desired. 如果需要,保留选项以允许用户切换到“经典”主题(如上所述)。

Windows Vista completely overhauled Windows's theming engine and introduced a new UI known as "Aero". Windows Vista完全彻底改变了Windows的主题引擎,并引入了一个名为“Aero”的新UI。 This provides flashy-looking windows and controls, complete with transparency effects—that is, as long as your graphics card supports it. 这提供了华丽的窗口和控件,并具有透明效果 - 只要您的图形卡支持它。 Again, by explicitly linking to version 6 of ComCtl32.dll, your application would automatically get all of these styles applied. 同样,通过显式链接到ComCtl32.dll的版本6,您的应用程序将自动应用所有这些样式。

It's worth noting that through all of this, Microsoft has provided users with the ability to customize the colors (and fonts and other things) used in the user interface. 值得注意的是,通过所有这些,Microsoft为用户提供了自定义用户界面中使用的颜色 (以及字体和其他东西)的能力。 For example, Aero defaults to blue. 例如,Aero默认为蓝色。 If you don't like blue, you can change it. 如果你不喜欢蓝色,你可以改变它。 I change my UI colors periodically for fun and to re-energize myself. 我定期更改我的UI颜色以获得乐趣并重新激活自己。 If you can't read or don't like the font, you change it, too. 如果您无法阅读或不喜欢该字体,您也可以更改它。

Thus, if you choose to do something different with your application, defining your own custom color palette and ignoring the options chosen by the user through the provided customization interface, your app is going to look broken and stick out like a sore thumb on the user's desktop. 因此,如果您选择对您的应用程序执行不同的操作 ,定义您自己的自定义调色板并忽略用户通过提供的自定义界面选择的选项,您的应用程序将看起来很破碎并像用户的拇指一样伸出来桌面。 When designing a UI, the last thing you want to do is to be or look different. 在设计UI时,您要做的最后一件事是成为或看起来与众不同。

In short, upgrade your computer to Windows Vista or later and enable the Aero interface if you want flashy. 简而言之,如果您想要华而不实,请将计算机升级到Windows Vista或更高版本并启用Aero界面。 Don't override the user or try to custom draw all of your controls. 不要覆盖用户或尝试自定义绘制所有控件。 You'll just end up with an application that is hard to use, doesn't work as expected, is a pain in the rear to maintain, and just generally looks worse than if you'd simply left it alone. 你最终会得到一个难以使用的应用程序,不能按预期工作,后面的维护很痛苦,而且通常看起来比你只是单独留下它更糟糕。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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