|
发表于 2009-10-25 22:09:47
|
显示全部楼层
皮肤预览工具源码!
if not FileExists("SkinCrafterDll.dll") Then
MsgBox(64, "错误", "当前目录SkinCrafterDll.dll文件丢失",5)
Exit
EndIf
$xx=0
$search = FileFindFirstFile("*.skf")
If $search = -1 Then
MsgBox(64, "错误", "当前目录没有可用的.skf文件",5)
Exit
EndIf
While 1
$file = FileFindNextFile($search)
If @error Then ExitLoop
$bf=$file
$xx=$xx+1
WEnd
FileClose($search)
#include <GUIConstantsEx.au3>
MsgBox(64,"提示","一共找到"&$xx&"张皮肤")
Global $Dll , $Progress1
formbf()
Func formbf()
$Form1 = GUICreate("皮肤例子", 345, 184, 313, 309)
_SkinGUI("SkinCrafterDll.dll", $bf, $Form1)
$Group1 = GUICtrlCreateGroup("基本", 8, 8, 321, 129)
$Combo1 = GUICtrlCreateCombo("选择皮肤", 24, 40, 105, 25)
GUICtrlSetData($Combo1,$bf)
$Input1 = GUICtrlCreateInput("内容", 24, 80, 97, 21)
$Checkbox1 = GUICtrlCreateCheckbox("哈哈", 152, 32, 45, 25)
$Radio1 = GUICtrlCreateRadio("嘻嘻", 152, 72, 45, 25)
$List1 = GUICtrlCreateList("", 216, 32, 81, 84)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Progress1 = GUICtrlCreateProgress(8, 154, 241, 10)
$Button1 = GUICtrlCreateButton("退出", 272, 144, 49, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
GUICtrlSetData($Input1,$bf &"皮肤")
$search = FileFindFirstFile("*.skf")
If $search = -1 Then
MsgBox(64, "错误", "当前目录没有可用的.skf文件",5)
Exit
EndIf
While 1
$file = FileFindNextFile($search)
If @error Then ExitLoop
GUICtrlSetData($List1,$file)
GUICtrlSetData($Combo1,$file)
WEnd
FileClose($search)
jd()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Quit()
Exit
case $Button1
Quit()
Exit
Case $Combo1
$bf=GUICtrlRead ( $Combo1)
GUIDelete ( $Form1)
formbf()
ExitLoop
Case $List1
$bf=GUICtrlRead ( $List1)
GUIDelete ( $Form1)
formbf()
ExitLoop
EndSwitch
WEnd
EndFunc
Func _SkinGUI($SkincrafterDll, $SkincrafterSkin, $Handle)
$Dll = DllOpen($SkincrafterDll)
MsgBox(0,"",$SkincrafterSkin);
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
Func Quit()
GUISetState(@SW_HIDE)
DllCall($Dll, "int:cdecl", "DeInitDecoration")
DllCall($Dll, "int:cdecl", "RemoveSkin")
DllClose($Dll)
;DirRemove(@AppDataDir&"\skin",1)
Exit
EndFunc
Func jd()
GUICtrlSetData($Progress1,"10%")
Sleep(100)
GUICtrlSetData($Progress1,"20%")
Sleep(100)
GUICtrlSetData($Progress1,"30%")
Sleep(100)
GUICtrlSetData($Progress1,"40%")
Sleep(100)
GUICtrlSetData($Progress1,"50%")
Sleep(100)
GUICtrlSetData($Progress1,"60%")
Sleep(100)
GUICtrlSetData($Progress1,"70%")
Sleep(100)
GUICtrlSetData($Progress1,"80%")
Sleep(100)
GUICtrlSetData($Progress1,"90%")
Sleep(100)
GUICtrlSetData($Progress1,"100%")
Sleep(100)
EndFunc |
|