#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <SliderConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
;;;皮肤贼如代码-------从这里开始-----------------------------------------------////
FileInstall("USkin.dll", @TempDir & "\USkin.Dll") ;这里是将脚本目录里面的Uskin.dll镶入到EXE文件里面,当EXE文件运行的时候自动将文件放置临时目录【@TempDir】里面运行。
FileInstall("Skin.msstyles", @TempDir & "\Skin.msstyles") ;这里是将脚本目录里面的【Skins\Skin.msstyles】文件镶入到EXE文件里面,当EXE文件运行的时候自动将文件放置临时目录【@TempDir】里面运行。
FileInstall("Skin1.msstyles", @TempDir & "\Skin1.msstyles")
$skins = @TempDir & "\Skin.msstyles" ;这里设定【$skins】为皮肤路径
$Dll_ = DllOpen(@TempDir & "\USkin.dll") ;这里设定【$Dll_】为皮肤调用文件【USkin.dll】的路径
DllCall($Dll_, "int", "USkinInit", "str", "Null", "str", "NULL", "str", $skins) ;载入皮肤到DLL返回值
DllCall($Dll_, "int", "USkinLoadSkin", "str", $skins) ;启用皮肤
;;;皮肤贼如代码-------到这里结束-----------------------------------------------////
#region ### START Koda GUI section ### Form=
$Form2 = GUICreate("窗体1", 254, 208, 267, 215)
$Button1 = GUICtrlCreateButton("默认皮肤", 16, 152, 97, 33)
$Button2 = GUICtrlCreateButton("更换皮肤", 120, 152, 113, 33)
$Input1 = GUICtrlCreateInput("Input1", 8, 8, 233, 21)
$Progress1 = GUICtrlCreateProgress(8, 32, 233, 17)
$Slider1 = GUICtrlCreateSlider(8, 56, 233, 25)
$Tab1 = GUICtrlCreateTab(8, 88, 233, 49)
$TabSheet1 = GUICtrlCreateTabItem("TabSheet1")
$TabSheet2 = GUICtrlCreateTabItem("TabSheet2")
$TabSheet3 = GUICtrlCreateTabItem("TabSheet3")
$TabSheet4 = GUICtrlCreateTabItem("TabSheet4")
GUICtrlSetState(-1, $GUI_SHOW)
GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Quit()
Exit
Case $Button2
Quit()
$skins = @TempDir & "\Skin1.msstyles" ;这里设定【$skins】为皮肤路径
$Dll_ = DllOpen(@TempDir & "\USkin.dll") ;这里设定【$Dll_】为皮肤调用文件【USkin.dll】的路径
DllCall($Dll_, "int", "USkinInit", "str", "Null", "str", "NULL", "str", $skins) ;载入皮肤到DLL返回值
DllCall($Dll_, "int", "USkinLoadSkin", "str", $skins) ;启用皮肤
GUISetState()
EndSwitch
WEnd
Func Quit()
GUISetState(@SW_HIDE) ;这里先将界面隐藏起来,因为要先关闭皮肤后才关闭软件,所以隐藏界面后关闭皮肤的话就不会看到没有皮肤的界面了。
DllCall($Dll_, "int", "USkinRemoveSkin") ;这里是关闭皮肤
DllCall($Dll_, "int", "USkinExit") ;这里是退出皮肤调用的DLL
DllClose($Dll_) ;关闭DLL文件调用
;FileDelete( @TempDir & "\Skins\Skin.msstyles") ;删除临时目录里面的皮肤文件
;FileDelete(@TempDir & "\Uskin.dll") ;删除临时目录里面的USkin.dll文件
;Exit ;退出脚本(关闭软件)
EndFunc ;==>Quit