Visual Style中的shellstyle.dll文件修改方法

所属分类: 实用技巧 / 应用技巧 阅读数: 958
收藏 0 赞 0 分享
Visual Style中的shellstyle.dll文件修改 
2007-3-8 11:25:00 
作者: Silencer 
shellstyle.dll修改 *部分内容参考自whistl3r的Shellstyle Tutorial

预备知识
1.shellstyle.dll的结构
UIFiles:
UIFile1:定义窗体及任务列表样式
UIFile2:定义控制面板样式

Resources:资源文件列表
10,11,12:音乐文件夹
13,14,15:图片文件夹
16,17,18:查找
19,20,21:视频文件夹
22,26:控制面板
25:系统文件夹
100,101,102,103,104,105,106,107:面板打开/关闭按钮
110,112:面板顶栏
120:背景

Strings:定义常用字符串或数值(字体,字号)

CPWEBVW.CSS:定义用户帐户窗体样式

2.资源的使用
rcstr(Str_ID)
Str_ID:Strings中编号

rcbmp(BMP_ID, STRETCHING, TRANSPARENT_COLOR, WIDTH, HEIGHT, SIZE_FLAG, MIRROR)
BMP_ID:Resources中编号
STRETCHING: 填充方式 1 = 正常, 3, = 重复, 6 = 拉伸, 7 = 32bit位图
TRANSPARENT_COLOR: 填充时忽略的颜色 #RRGGBB
WIDTH, HEIGHT:宽度,高度
SIZE_FLAG: 图像大小 1 = 使用图片默认大小, 0 = 使用指定的大小
MIRROR: 反转 0 = 正常, 1 = 反转

rcint(Str_ID) //将字符串转为数值
Str_ID:Strings中编号

Dtb(handlemap(a),b,c) //猜测是一种获取当前主题中图像的方法,但a,b,c各值所代表的图像不是很明确

sysmetric(ID) //系统变量表
ID可取值:
0 Screen width
1 Screen height
2 Width of sizable window frame
3 Height of sizable window frame
4 Width of scroll arrows on vertical scroll bar
5 Height of scroll arrows on vertical scroll bar
6 Width of scroll arrows on horizontal scroll bar
7 Height of scroll arrows on horizontal scroll bar
8 Height of window title
9 Width of non-sizable window frame
10 Height of non-sizable window frame
11 Width of DOUBLE or PANEL window frame
12 Height of DOUBLE or PANEL window frame
13 Scroll box width on horizontal scroll bar in text editing windows
14 Scroll box height on vertical scroll bar in text editing windows
15 Minimized window icon width
16 Minimized window icon height
17 Maximum insertion point width
18 Maximum insertion point height
19 Single-line menu bar height
20 Maximized window width
21 Maximized window height
22 Kanji window height
23 Minimum sizable window width
24 Minimum sizable window height
25 Minimum window width
26 Minimum window height
27 Window controls width
28 Window controls height
29 1 if mouse hardware present; otherwise 0
30 1 for Microsoft Windows debugging version; otherwise 0
31 1 if mouse buttons swapped; otherwise 0
32 Width of a button in a half-caption window's caption or title bar
33 Height of half-caption window caption area

核心部分
UIFile的编写
UIFile中的内容是许多结构为
<style resid=***>
...
Element [id=atom(*****)]
{...}
Element [id=atom(*****)]
{...}
...
...
</style>
的代码段,用于定义特定部分的样式及其内部元素的样式
其中可包含的属性有
contentalign: //元素位置。可有以下值
top: topleft, topright, topcenter
middle: middleleft, middleright, middlecenter
bottom: bottomleft, bottomright, bottomcenter
wrap: wrapleft, wrapright, wrapcenter //只可用于文本

background: //背景颜色
foreground: //前景颜色
bordercolor: //边界颜色 这3个属性可有以下值
rgb(red,green,blue) //RGB颜色
argb(alpha,red,green,blue) //包含alpha通道
gradient(argb(alpha,red,green,blue), argb(alpha,red,green,blue), Direction) //渐变色,第1个颜色变量为左上,第2个右下 Driection:方向 0 = 水平, 1 = 垂直
black, white, red, green, blue, ... //直接描述
window, windowtext, buttonface, buttonshadow, buttonlight, buttontext, scrollbar, hotlight, activecaption, captiontext... //系统颜色

fontsize: //字号
使用Strings表中值

fontface: //字体
使用Strings表中值

fontstyle: //字体样式
使用normal, bold, italic, underline等制

borderthickness: rect(left,top,right,bottom); //边框宽度

margin: rect(left,top,right,bottom); //缩放时保持不变的边缘宽度
padding: rect(left,top,right,bottom); //元素位置

以XP默认主题Luna的UIFile1为例
<style resid=main> //主窗体
DUIListView [id=atom(listview)] //列表浏览
{
contentalign: middlecenter;
fontsize: sysmetric(-16); //sysmetric是系统变量表,对应的变量类型见前表
fontweight: sysmetric(-17);
fontstyle: sysmetric(-18);
fontface: sysmetricstr(6);
}
DUIAxHost [id=atom(preview)] //幻灯片浏览
{
contentalign: middlecenter;
borderthickness: rect(20rp,20rp,20rp,20rp);
bordercolor: rgb(255,0,0);
}
Element
{
background: argb(0,0,0,0);
}
Element [id=atom(blockade)] //系统文件夹
{
background: rgb(99,117,214);
borderthickness: rect(0rp,0rp,1rp,1rp);
bordercolor: white;
}
Element [id=atom(blockadeaccent)] //主窗口与侧边栏间的分割线
{
background: gradient(argb(0,148,187,255), argb(0,99,117,214), 1);
}
Element [id=atom(blockadeclient)] //系统文件夹背景图片
{
contentalign: bottomright;
padding: rect (10rp,0rp,0rp,0rp);
}
Element [id=atom(blockadetitle)] //标题("这些文件是隐藏的")
{
fontface: rcstr(2);
fontsize: rcint(18)pt;
fontweight: rcint(11);
foreground: rgb(214,223,245);
background: argb(0,0,0,0);
padding: rect (0rp,20rp,10rp,0rp);
contentalign: wrapleft;
}
Element [id=atom(blockademessage)] //标题("此文件夹包含使您系统...")
{
fontface: rcstr(2);
fontsize: rcint(17)pt;
fontweight: rcint(12);
foreground: white;
background: argb(0,0,0,0);
padding: rect (1rp,15rp,10rp,0rp);
contentalign: wrapleft;
}
Element [id=atom(blockadeclear)] //"显示此文件夹内容"一般状态
{
margin: rect(0rp,20rp,0rp,0rp);
}
Button [id=atom(blockadeclearbutton)][keyfocused] //"显示此文件夹内容"键盘触发
{
contentalign: focusrect;
}
Element [id=atom(blockadecleartext)]
{
fontface: rcstr(1);
fontsize: rcint(15)pt;
fontweight: rcint(10);
foreground: white;
background: argb(0,0,0,0);
contentalign: wrapleft;
padding: rect (3rp,0rp,0rp,0rp);
}
Element [id=atom(blockadecleartext)][mousefocused] //"显示此文件夹内容"鼠标触发
{
cursor: hand;
fontstyle: underline;
}
</style>
//以下各块中元素不再赘述,功能请参阅whistl3r的Shellstyle Tutorial
<style resid=mainsectionss>
<style resid=mainsectiontaskss>
<style resid=sectionss>
<style resid=sectiontaskss>
<style resid=taskpane>
<style resid=NameSpaceItemInfoList>
更多精彩内容其他人还在看

Win XP系统语言栏丢失解决三例

案例一:   问:一台计算机使用Windows XP操作系统,最近任务栏内无法显示语言栏,我通过“区域和语言选项”里的设置找回了语言栏,重新启动计算机后,问题依旧,请问是什么问题造成的?
收藏 0 赞 0 分享

设计软件中的系统字体应用小技巧

大家都知道,在操作系统的安装目录下有字体库,要使用种字体首先需要安装,但是这会造成字体占用系统盘空间过多。设计使用的字体都不少,怎么说也有几个G,很占资源,下面教大家一个稍微节省资源的方法。
收藏 0 赞 0 分享

Access中字段上自动打开的输入法的解决方法

打开Access数据库时,在里面数据表字段输入数值时,总是会跳出输入法来,很是烦人,在网上找了一下,找到了相应的解决办法:
收藏 0 赞 0 分享

“internet explore 无法打开internet站点 已终止操作”的解决方法

在IE下,当页面还没有加载完全时,如果正在执行的JS代码中含有使用了document.createElement的话,很容易引起页面加载失败.导致提示"internet explore 无法打开internet站点 http://www.xxx.com/xxx/xxx.
收藏 0 赞 0 分享

十个习惯让你精通新的开发技术

这篇文章,是从我的《高效开发人员的五个特征》一文中抽出的一个观点。从我自身的事业和习惯中,我考虑了很多方式怎么样才能有效地学习。
收藏 0 赞 0 分享

小谈RADMIN爆破

最近做渗透测试时常碰到RADMIN一类的东西.. 一碰到此类的程序,一般我都会先看下对方把RADMIN的端口配置成什么..以及相应的PASS(加密过的)
收藏 0 赞 0 分享

动易2006序列号破解算法公布

动易2007就快发布了,把2006的算法公开吧,赚点人气,希望动易不要来找我 。
收藏 0 赞 0 分享

联众密码的逆向算法公布

闲来无事,每天上联众,联众的密码经过加密后保存在本地注册表里,看看是怎么加密的。下了个ollydbg,一路跟踪,发现算法极其简单,给出Delphi版本的解密算法(加密部分有兴趣的一起来讨论)。算法比较粗糟,谁帮优化一下:)
收藏 0 赞 0 分享

关于三种主流WEB架构的思考

做WEB好几年了,各种语言和技术都稍有涉猎。今天心血来潮,突然想总结一下。其实不论什么技术,什么需求,通常WEB开发就是通过WEB前端管理一个或大或小或独立或分布式的关系型数据库,很多东西都是相通的。这里说的WEB架构,是指WEB应用开发中每种技术独有的资源组织形式(包括文件,数
收藏 0 赞 0 分享

一篇关于程序员性格的文章第1/3页

软件开发中人们很少注意个人性格问题。自从 1965年Edsger Dijkstra的有里程碑意义的文章“程序开发是一种人类活动”发表以来,程序员性格被认为是合理的和有成效的研究领域,虽然有些题目如“大桥建筑者的心理”和“对律师行为的研究实验”看起来可能是荒唐的,而在计算机领域,“
收藏 0 赞 0 分享
查看更多