au3 vista皮肤的使用问题
本帖最后由 YoDe 于 2010-1-29 15:37 编辑本人用AU3写的一个小程序 如果用TabItem切换标签 打开软件后 然后再运行另一个窗口 拖动到我写的AU3程序上则会出现如下图
运行软件
用其他窗口覆盖住我的AU3程序
结果就这样了 我贴上源代码 高手帮我看看..
#NoTrayIcon
#Region ;**** 参数创建于 AutoIt3Wrapper_GUI ****
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=ico.ico
#AutoIt3Wrapper_Outfile= 魔兽争霸版本切换器.exe
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_Res_Comment= 魔兽争霸版本切换器
#AutoIt3Wrapper_Res_Description= 魔兽争霸版本切换器
#AutoIt3Wrapper_Res_Fileversion=1.0.2.1
#AutoIt3Wrapper_Res_LegalCopyright=版权所有(C)2002-2008 YoDe
#AutoIt3Wrapper_Res_Field=Email|640753@qq.com
#AutoIt3Wrapper_Res_Field=QQ/TM|640753
#AutoIt3Wrapper_Res_Field=作者:|YoDe
#AutoIt3Wrapper_Res_Field=产品版本|1.0.0.0
#AutoIt3Wrapper_Au3Check_Stop_OnWarning=y
#AutoIt3Wrapper_Run_Tidy=y]
#include <GUIConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$checkwar3 = "魔兽争霸版本切换器"
If WinExists($checkwar3) Then Exit ; 此脚本已经运行了
Opt("TrayAutoPause", 0)
Opt("TrayMenuMode", 1)
Opt("TrayOnEventMode", 1) ;应用OnEvent函数于系统托盘图标
Opt("guicloseonesc", 0) ;此处为程序运行时按下ESC不发送消息,否则按下ESC键后,退出程序
Opt("onexitfunc", "quit") ;设置脚本退出时调用的函数
FileInstall("SkinCrafterDll.dll", @TempDir & "\SkinCrafterDll.dll", 1)
FileInstall("vista.skf", @TempDir & "\vista.skf", 1)
FileInstall("logo.bmp", @TempDir & "\logo.bmp ", 1)
Dim $WAR3ver
;以上为程序开始时必须要做的一些事
;以下为检查配置文件设置
$soft_ini = FileOpen("path.ini", 0) ;打开配置文件
If $soft_ini = -1 Then
MsgBox(16, "错误", '请检查配置文件' & @ScriptDir & '\"path.ini"是否存在!') ;@ScriptDir为脚本所在目录
Exit
EndIf
;下面为读取配置文件为变量 以便程序调用
$name1 = IniRead("path.ini", "1", "游戏版本", "未选择版本")
$name2 = IniRead("path.ini", "2", "游戏版本", "未选择版本")
$name3 = IniRead("path.ini", "3", "游戏版本", "未选择版本")
$name4 = IniRead("path.ini", "4", "游戏版本", "未选择版本")
$name5 = IniRead("path.ini", "5", "游戏版本", "未选择版本")
$name6 = IniRead("path.ini", "6", "游戏版本", "未选择版本")
$name7 = IniRead("path.ini", "6", "游戏版本", "未选择版本")
$name8 = IniRead("path.ini", "6", "游戏版本", "未选择版本")
$name9 = IniRead("path.ini", "6", "游戏版本", "未选择版本")
$path7 = IniRead("path.ini", "1", "游戏补丁路径", "")
$path8 = IniRead("path.ini", "2", "游戏补丁路径", "")
$path9 = IniRead("path.ini", "3", "游戏补丁路径", "")
$path10 = IniRead("path.ini", "4", "游戏补丁路径", "")
$path11 = IniRead("path.ini", "5", "游戏补丁路径", "")
$path12 = IniRead("path.ini", "6", "游戏补丁路径", "")
$path13 = IniRead("path.ini", "6", "游戏补丁路径", "")
$path14 = IniRead("path.ini", "6", "游戏补丁路径", "")
$war3path = IniRead("path.ini", "path", "war3path", "")
$WAR3ver = FileGetVersion($war3path & "game.dll")
;以上为读取配置文件信息 YODE 注
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("魔兽争霸版本切换器 作者:YoDe", 400, 315, -1, -1)
_SkinGUI(@TempDir & "\SkinCrafterDll.dll", @TempDir & "\vista.skf", $Form1)
$Pic1 = GUICtrlCreatePic("E:\魔兽争霸切换\logo.bmp", 0, 0, 400, 90, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
GUICtrlCreateLabel("│", 260, 296, 120, 16)
GUICtrlSetFont(-1, 16, 100, 0, "宋体")
GUICtrlSetState(-1, $GUI_DISABLE)
$group1 = GUICtrlCreateGroup("请选择你要切换的版本", 15, 125, 370, 160)
GUIStartGroup()
$bar = GUICtrlCreateLabel("欢迎使用魔兽争霸版本切换器", 50, 299, 220, 12)
$link = GUICtrlCreateLabel("YoDe制作 QQ:640753", 280, 299, 110, 12)
GUICtrlSetColor(-1, 0x0000FF)
GUICtrlCreateTab(1, 89, 398, 205)
$tab1 = GUICtrlCreateTabItem(" 版本切换 ")
$button1 = GUICtrlCreateButton("确 定", 290, 240, 80, 25)
$Combo1 = GUICtrlCreateCombo($name1, 222, 210, 145, 25)
GUICtrlSetData(-1, $name2 & "|" & $name3 & "|" & $name4 & "|" & $name5 & "|" & $name6 & "|" & $name7 & "|" & $name8 & "|" & $name9, "未设置")
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Label3 = GUICtrlCreateLabel("你现在的魔兽争霸版本为:" & @CRLF & " " & $WAR3ver, 220, 160, 160, 25)
#EndRegion ### END Koda GUI section ###
GUICtrlCreateTabItem("分辨率设置")
$button_1 = GUICtrlCreateButton("设 置", 290, 240, 80, 25)
$group_1 = GUICtrlCreateGroup("请选择适合你的分辨率", 15, 125, 370, 160)
GUIStartGroup()
$radio_1 = GUICtrlCreateRadio("800*600", 40, 174, 80, 15)
$radio_2 = GUICtrlCreateRadio("1024*768", 120, 174, 80, 17)
$radio_3 = GUICtrlCreateRadio("1280*1024", 200, 174, 90, 17)
$radio_4 = GUICtrlCreateRadio("17寸宽屏", 40, 238, 70, 20)
$radio_5 = GUICtrlCreateRadio("19寸宽屏", 120, 238, 70, 20)
GUICtrlSetState(-1, $GUI_CHECKED)
$radio_6 = GUICtrlCreateRadio("22寸宽屏", 200, 238, 70, 20)
$group_book = GUICtrlCreateGroup("宽屏液晶", 25, 225, 260, 37)
GUISetState(@SW_SHOW)
$WAR3ver = FileGetVersion($war3path & "game.dll")
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
Exit
Case $msg = $button1
If $name1 = GUICtrlRead($Combo1) Then
GUICtrlSetState($button1, $GUI_DISABLE)
DirCopy($path7, $war3path, 1)
MsgBox(64, "提示", "游戏版本切换完成!")
$WAR3ver = FileGetVersion($war3path & "game.dll")
GUICtrlSetData($Label3, "你现在的魔兽争霸版本为:" & " " & $WAR3ver)
GUICtrlSetState($button1, $GUI_ENABLE)
ElseIf $name2 = GUICtrlRead($Combo1) Then
GUICtrlSetState($button1, $GUI_DISABLE)
DirCopy($path8, $war3path, 1)
MsgBox(64, "提示", "游戏版本切换完成!")
$WAR3ver = FileGetVersion($war3path & "game.dll")
GUICtrlSetData($Label3, "你现在的魔兽争霸版本为:" & " " & $WAR3ver)
GUICtrlSetState($button1, $GUI_ENABLE)
ElseIf $name3 = GUICtrlRead($Combo1) Then
GUICtrlSetState($button1, $GUI_DISABLE)
DirCopy($path9, $war3path, 1)
MsgBox(64, "提示", "游戏版本切换完成!")
$WAR3ver = FileGetVersion($war3path & "game.dll")
GUICtrlSetData($Label3, "你现在的魔兽争霸版本为:" & " " & $WAR3ver)
GUICtrlSetState($button1, $GUI_ENABLE)
ElseIf $name4 = GUICtrlRead($Combo1) Then
GUICtrlSetState($button1, $GUI_DISABLE)
DirCopy($path10, $war3path, 1)
MsgBox(64, "提示", "游戏版本切换完成!")
$WAR3ver = FileGetVersion($war3path & "game.dll")
GUICtrlSetData($Label3, "你现在的魔兽争霸版本为:" & " " & $WAR3ver)
GUICtrlSetState($button1, $GUI_ENABLE)
ElseIf $name5 = GUICtrlRead($Combo1) Then
GUICtrlSetState($button1, $GUI_DISABLE)
DirCopy($path11, $war3path, 1)
MsgBox(64, "提示", "游戏版本切换完成!")
$WAR3ver = FileGetVersion($war3path & "game.dll")
GUICtrlSetData($Label3, "你现在的魔兽争霸版本为:" & " " & $WAR3ver)
GUICtrlSetState($button1, $GUI_ENABLE)
ElseIf $name6 = GUICtrlRead($Combo1) Then
GUICtrlSetState($button1, $GUI_DISABLE)
DirCopy($path12, $war3path, 1)
MsgBox(64, "提示", "游戏版本切换完成!")
$WAR3ver = FileGetVersion($war3path & "game.dll")
GUICtrlSetData($Label3, "你现在的魔兽争霸版本为:" & " " & $WAR3ver)
GUICtrlSetState($button1, $GUI_ENABLE)
ElseIf $name7 = GUICtrlRead($Combo1) Then
GUICtrlSetState($button1, $GUI_DISABLE)
DirCopy($path13, $war3path, 1)
MsgBox(64, "提示", "游戏版本切换完成!")
$WAR3ver = FileGetVersion($war3path & "game.dll")
GUICtrlSetData($Label3, "你现在的魔兽争霸版本为:" & " " & $WAR3ver)
ElseIf $name8 = GUICtrlRead($Combo1) Then
GUICtrlSetState($button1, $GUI_DISABLE)
DirCopy($path14, $war3path, 1)
MsgBox(64, "提示", "游戏版本切换完成!")
$WAR3ver = FileGetVersion($war3path & "game.dll")
GUICtrlSetData($Label3, "你现在的魔兽争霸版本为:" & " " & $WAR3ver)
GUICtrlSetState($button1, $GUI_ENABLE)
ElseIf GUICtrlRead($Combo1) = "未选择版本" Then
GUICtrlSetState($button1, $GUI_DISABLE)
MsgBox(16, "提示", "您没有选择游戏版本,请检查配置文件!")
GUICtrlSetState($button1, $GUI_ENABLE)
Else
MsgBox(16, "提示", "您没有选择正确的游戏版本!")
EndIf
Case $msg = $button_1
If GUICtrlRead($radio_1) = 1 Then
v1()
EndIf
If GUICtrlRead($radio_2) = 1 Then
v2()
EndIf
If GUICtrlRead($radio_3) = 1 Then
v3()
EndIf
If GUICtrlRead($radio_4) = 1 Then
v4()
EndIf
If GUICtrlRead($radio_5) = 1 Then
v5()
EndIf
If GUICtrlRead($radio_6) = 1 Then
v6()
EndIf
EndSelect
WEnd
;皮肤调用
Func _SkinGUI($SkincrafterDll, $SkincrafterSkin, $Handle)
$Dll = DllOpen($SkincrafterDll)
DllCall($Dll, "int:cdecl", "InitLicenKeys", "wstr", "1", "wstr", "", "wstr", "1@1.com", "wstr", "1")
DllCall($Dll, "int:cdecl", "InitDecoration", "int", 1)
DllCall($Dll, "int:cdecl", "LoadSkinFromFile", "wstr", $SkincrafterSkin)
DllCall($Dll, "int:cdecl", "DecorateAs", "int", $Handle, "int", 25)
DllCall($Dll, "int:cdecl", "ApplySkin")
EndFunc ;==>_SkinGUI
;设置魔兽分辨率
Func v1()
GUICtrlSetState($button_1, $GUI_DISABLE)
RegWrite("HKEY_CURRENT_USER\Software\Blizzard Entertainment\Warcraft III\Video", "reswidth", "REG_DWORD", "800")
RegWrite("HKEY_CURRENT_USER\Software\Blizzard Entertainment\Warcraft III\Video", "resheight", "REG_DWORD", "600")
RegWrite("HKEY_CURRENT_USER\Software\Blizzard Entertainment\Warcraft III\Video", "colordepth", "REG_DWORD", "32")
MsgBox(64, "提示", "分辨率设置完成", 3)
EndFunc ;==>v1
Func v2()
GUICtrlSetState($button_1, $GUI_DISABLE)
RegWrite("HKEY_CURRENT_USER\Software\Blizzard Entertainment\Warcraft III\Video", "reswidth", "REG_DWORD", "1024")
RegWrite("HKEY_CURRENT_USER\Software\Blizzard Entertainment\Warcraft III\Video", "resheight", "REG_DWORD", "768")
RegWrite("HKEY_CURRENT_USER\Software\Blizzard Entertainment\Warcraft III\Video", "colordepth", "REG_DWORD", "32")
MsgBox(64, "提示", "分辨率设置完成", 3)
EndFunc ;==>v2
Func v3()
GUICtrlSetState($button_1, $GUI_DISABLE)
RegWrite("HKEY_CURRENT_USER\Software\Blizzard Entertainment\Warcraft III\Video", "reswidth", "REG_DWORD", "1280")
RegWrite("HKEY_CURRENT_USER\Software\Blizzard Entertainment\Warcraft III\Video", "resheight", "REG_DWORD", "1024")
RegWrite("HKEY_CURRENT_USER\Software\Blizzard Entertainment\Warcraft III\Video", "colordepth", "REG_DWORD", "32")
MsgBox(64, "提示", "分辨率设置完成", 3)
EndFunc ;==>v3
Func v4()
GUICtrlSetState($button_1, $GUI_DISABLE)
RegWrite("HKEY_CURRENT_USER\Software\Blizzard Entertainment\Warcraft III\Video", "reswidth", "REG_DWORD", "1280")
RegWrite("HKEY_CURRENT_USER\Software\Blizzard Entertainment\Warcraft III\Video", "resheight", "REG_DWORD", "720")
RegWrite("HKEY_CURRENT_USER\Software\Blizzard Entertainment\Warcraft III\Video", "colordepth", "REG_DWORD", "32")
MsgBox(64, "提示", "分辨率设置完成", 3)
EndFunc ;==>v4
Func v5()
GUICtrlSetState($button_1, $GUI_DISABLE)
RegWrite("HKEY_CURRENT_USER\Software\Blizzard Entertainment\Warcraft III\Video", "reswidth", "REG_DWORD", "1440")
RegWrite("HKEY_CURRENT_USER\Software\Blizzard Entertainment\Warcraft III\Video", "resheight", "REG_DWORD", "900")
RegWrite("HKEY_CURRENT_USER\Software\Blizzard Entertainment\Warcraft III\Video", "colordepth", "REG_DWORD", "32")
MsgBox(64, "提示", "分辨率设置完成", 3)
EndFunc ;==>v5
Func v6()
GUICtrlSetState($button_1, $GUI_DISABLE)
RegWrite("HKEY_CURRENT_USER\Software\Blizzard Entertainment\Warcraft III\Video", "reswidth", "REG_DWORD", "1680 ")
RegWrite("HKEY_CURRENT_USER\Software\Blizzard Entertainment\Warcraft III\Video", "resheight", "REG_DWORD", "1050")
RegWrite("HKEY_CURRENT_USER\Software\Blizzard Entertainment\Warcraft III\Video", "colordepth", "REG_DWORD", "32")
MsgBox(64, "提示", "分辨率设置完成", 3)
EndFunc ;==>v6 怎么没人回答! WinSetOnTop("标题","窗口文本",1) 楼上的不行啊 首先感谢一下 不过你这样只是让窗口置顶 而不能做到 其他窗口移到我的AU3程序界面上后一开依然正常...希望高手帮帮小弟 论坛怎么没人了哦 我做的也常常出现这样的情况,兄弟,帮你顶上去
http://lwc.nhome.cn/code/showip.asp 还是没人鸟我 哈哈 继续顶 顶到高手出马 看来 没有办法解决了 无头命案 用USkin试试 新手!!不懂,帮顶 多半是皮肤问题。我也是因此放弃了这种皮肤。。 新手!!不懂,帮顶
页:
[1]