首页
社区
课程
招聘
请教关于汇编语言实现XP界面的方法
发表于: 2006-12-4 20:55 6680

请教关于汇编语言实现XP界面的方法

2006-12-4 20:55
6680
这个问题在下面这篇文章中有讲述:

标 题:汇编语言中XP风格的实现 (1千字)
发信人:jr21066
时 间:2004-01-21 11:21:53

    可是这篇文章好象没有仔细整理,有一些疑问:
1. “在系统库Resource.h文件里加入"MOVEABLE  PURE"字符串”,头文件里都是define语句,如何加入字符串?
2. 代码不完整,不过aboil的文章“让RadASM创建带资源的工程时自动创建带有XP风格的工程”中的代码可以:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
    name="Microsoft.Windows.XXXX"
    processorArchitecture="x86"
    version="5.1.0.0"
    type="win32"/>
<description>Windows Shell</description>
<dependency>
    <dependentAssembly>
        <assemblyIdentity
            type="win32"
            name="Microsoft.Windows.Common-Controls"
            version="6.0.0.0"
            processorArchitecture="x86"
            publicKeyToken="6595b64144ccf1df"
            language="*"
        />
    </dependentAssembly>
</dependency>
</assembly>

    我从别处找到相应代码以后,曾经成功实现了xp风格的界面,可是把xp系统的新补丁打上以后,程序又不能运行啦,界面出不来,请问在打上新补丁以后如何实现xp风格?或者说我哪里做得不对?

[课程]Android-CTF解题方法汇总!

收藏
免费 7
支持
分享
最新回复 (8)
雪    币: 4833
活跃值: (2218)
能力值: ( LV9,RANK:170 )
在线值:
发帖
回帖
粉丝
2
Win32_Assembler_Coding_for_Crackers_by_Goppit_v11

Using XP Visual Style

You may notice that although the button outlines in WinAsm Resource editor have rounded corners in the XP style, the compiled executable displays the old style square cornered buttons. In order to use the new XP Visual Style with the common controls you must use a manifest file. This is a standard xml (extensible markup language) file which needs to be edited only to include the name of your app. The name of the xml file itself can be anything. It should be placed in the same folder as the source files and is specified by a single line in the resource script.

The manifest can be added to the project by clicking the Resources tab in the project explorer bar, clicking Resources then Add, and adding the manifest file. A resource name is not necessary but the ID for the manifest must always be 1 or it will not work:



This adds the following line to the resource script just below the icon line (which could be done manually):

1 24 DISCARDABLE "dialogbox2.xml"

Finally save dialogbox2.rc again and it should match the version in the sourcecode section.

Note the rounded buttons with the bluish outline. The manifest file is also included in the sourcecodes section. Just for reference the contents are as follows:

2006-12-4 21:43
0
雪    币: 253
活跃值: (250)
能力值: ( LV9,RANK:210 )
在线值:
发帖
回帖
粉丝
3
按oep1指出的名字处改为应用程序名(也有很多资料中也是这样写的),程序提示如下:

如果改成我贴的代码的形式,点击程序后没有任何提示,也不运行。如果不加这个manifest则程序执行是正常的,我想实现的就是xp界面。
2006-12-4 23:08
0
雪    币: 217
活跃值: (99)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
4
找一个能正常运行的manifest资源,copy一下
2006-12-5 09:04
0
雪    币: 390
活跃值: (707)
能力值: ( LV12,RANK:650 )
在线值:
发帖
回帖
粉丝
5


我直接用这个,没有问题
上传的附件:
2006-12-5 13:39
0
雪    币: 4833
活跃值: (2218)
能力值: ( LV9,RANK:170 )
在线值:
发帖
回帖
粉丝
6
这是我收藏的一个XML
上传的附件:
2006-12-5 17:48
0
雪    币: 253
活跃值: (250)
能力值: ( LV9,RANK:210 )
在线值:
发帖
回帖
粉丝
7
谢谢各位好心人!可是不知为什么我就是不能成功。大家有空的话帮我看一下这个怎样改才能编译出xp界面吧。
上传的附件:
2006-12-5 18:22
0
雪    币: 248
活跃值: (1056)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
8
+
;------------------------------------
include \masm32\include\comctl32.inc
includelib \masm32\lib\comctl32.lib
;------------------------------------
        invoke  InitCommonControls
2006-12-5 19:06
0
雪    币: 253
活跃值: (250)
能力值: ( LV9,RANK:210 )
在线值:
发帖
回帖
粉丝
9
    感谢各位大侠,尤其感谢sixL大侠!指出了要害,我终于成功啦!我在这里整理一下,让后来者少走一点弯路吧。
    要让一个用汇编语言编写的不具备xp风格的程序实现XP风格,只需以下4步:
1. 包含文件增加以下两个:
include    <comctl32.inc>
includelib <comctl32.lib>
2. 在程序初始化部分开头增加以下函数:
   invoke  InitCommonControls
3. 在资源文件中增加一行:
1 24 DISCARDABLE "XPStyle.xml"
    当然这个文件名是任意的。
4. 增加"XPStyle.xml"这个文件,内容为:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
    name="Microsoft.Windows.XXXX"
    processorArchitecture="x86"
    version="5.1.0.0"
    type="win32"/>
<description>Windows Shell</description>
<dependency>
    <dependentAssembly>
        <assemblyIdentity
            type="win32"
            name="Microsoft.Windows.Common-Controls"
            version="6.0.0.0"
            processorArchitecture="x86"
            publicKeyToken="6595b64144ccf1df"
            language="*"
        />
    </dependentAssembly>
</dependency>
</assembly>

    做完这四步,重新编译,其中的控件就具有xp风格啦。

    解决了这个问题,让我信心大增,其实我还有许多别的问题,再发贴子向大家请教吧。
2006-12-5 19:33
0
游客
登录 | 注册 方可回帖
返回
//