找回密码
 加入
搜索
查看: 3288|回复: 2

[AU3基础] GUID排序问题如何解决【已解决】

[复制链接]
发表于 2010-5-14 15:05:10 | 显示全部楼层 |阅读模式
本帖最后由 woeiwoei 于 2010-5-14 15:57 编辑
#Include <WinAPI.au3>
FileInstall("ai.ico",@TempDir&"\ai.ico")
FileInstall("qi.ico",@TempDir&"\qi.ico")
FileInstall("mo.ico",@TempDir&"\mo.ico")
FileInstall("fa.ico",@TempDir&"\fa.ico")
Dim $Guid[4]
$Guid[0]=_CreateGuid()
$Guid[1]=_CreateGuid()
$Guid[2]=_CreateGuid()
$Guid[3]=_CreateGuid()
$url = 'http://www.aiqmofa.cn/?webownerId=18131&childid=' & StringRegExpReplace(@ScriptName,'[^\d]', '')
RegWrite ( "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Extensions"&$Guid[0], "Default Visible", "REG_SZ", "Yes" )
RegWrite ( "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Extensions"&$Guid[0], "ButtonText", "REG_SZ", "爱请魔法" )
RegWrite ( "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Extensions"&$Guid[0], "CLSID", "REG_SZ", "{1FBA04EE-3024-11d2-8F1F-0000F87ABD16}" )
RegWrite ( "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Extensions"&$Guid[0], "Icon", "REG_SZ", @TempDir&"\ai.ico" )
RegWrite ( "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Extensions"&$Guid[0], "HotIcon", "REG_SZ", @TempDir&"\ai.ico")
RegWrite ( "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Extensions"&$Guid[0], "IeakPolicy", "REG_SZ", "" )
RegWrite ( "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Extensions"&$Guid[0], "Exec", "REG_SZ", $url)

RegWrite ( "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Extensions"&$Guid[1], "Default Visible", "REG_SZ", "Yes" )
RegWrite ( "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Extensions"&$Guid[1], "ButtonText", "REG_SZ", "爱请魔法" )
RegWrite ( "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Extensions"&$Guid[1], "CLSID", "REG_SZ", "{1FBA04EE-3024-11d2-8F1F-0000F87ABD16}" )
RegWrite ( "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Extensions"&$Guid[1], "Icon", "REG_SZ", @TempDir&"\qi.ico" )
RegWrite ( "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Extensions"&$Guid[1], "HotIcon", "REG_SZ", @TempDir&"\qi.ico")
RegWrite ( "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Extensions"&$Guid[1], "IeakPolicy", "REG_SZ", "" )
RegWrite ( "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Extensions"&$Guid[1], "Exec", "REG_SZ", $url)

RegWrite ( "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Extensions"&$Guid[2], "Default Visible", "REG_SZ", "Yes" )
RegWrite ( "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Extensions"&$Guid[2], "ButtonText", "REG_SZ", "爱请魔法" )
RegWrite ( "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Extensions"&$Guid[2], "CLSID", "REG_SZ", "{1FBA04EE-3024-11d2-8F1F-0000F87ABD16}" )
RegWrite ( "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Extensions"&$Guid[2], "Icon", "REG_SZ", @TempDir&"\mo.ico" )
RegWrite ( "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Extensions"&$Guid[2], "HotIcon", "REG_SZ", @TempDir&"\mo.ico")
RegWrite ( "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Extensions"&$Guid[2], "IeakPolicy", "REG_SZ", "" )
RegWrite ( "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Extensions"&$Guid[2], "Exec", "REG_SZ", $url)

RegWrite ( "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Extensions"&$Guid[3], "Default Visible", "REG_SZ", "Yes" )
RegWrite ( "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Extensions"&$Guid[3], "ButtonText", "REG_SZ", "爱请魔法" )
RegWrite ( "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Extensions"&$Guid[3], "CLSID", "REG_SZ", "{1FBA04EE-3024-11d2-8F1F-0000F87ABD16}" )
RegWrite ( "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Extensions"&$Guid[3], "Icon", "REG_SZ", @TempDir&"\fa.ico" )
RegWrite ( "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Extensions"&$Guid[3], "HotIcon", "REG_SZ", @TempDir&"\fa.ico")
RegWrite ( "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Extensions"&$Guid[3], "IeakPolicy", "REG_SZ", "" )
RegWrite ( "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Extensions"&$Guid[3], "Exec", "REG_SZ", $url)
Func _CreateGuid()
    Local $Guid = DllStructCreate($tagGUID)
    $Result = DllCall("OLE32.DLL", "dword", "CoCreateGuid", "ptr", DllStructGetPtr($Guid))
    $Result = _WinAPI_StringFromGUID(DllStructGetPtr($Guid))
    Return $Result
EndFunc
GUID 随机生成,但是也分‘大小’。我的问题是,在标准按钮栏创建4个按钮。每个按钮字不同。组合在一起是‘爱情魔法’这样的顺序。
我现在写的其他都成功了,就是排序问题。怎么对比生成的GUID 的大小并且按大小分配给 爱 请 魔 法 四个按钮啊?最小的为 爱 下来是情 依次这样。。。。
大大们帮帮忙啊。给下思路。。不胜感激!!

评分

参与人数 1金钱 +10 收起 理由
afan + 10 感谢主动将修改帖子分类为[已解决],请继续 ...

查看全部评分

 楼主| 发表于 2010-5-14 15:58:12 | 显示全部楼层
StringReplace自己搞定!
发表于 2011-8-21 12:21:20 | 显示全部楼层
回复 2# woeiwoei


    问一下LZ怎么写查看本机的GUID值啊??
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-10-1 19:28 , Processed in 0.081243 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表