|
本帖最后由 17911 于 2009-5-13 18:43 编辑
在官网资料区看见皮肤调用脚本如下,设置后发现皮肤文件只能在脚本根目录下才能调用,请问如果想调用D:\123中的皮肤文件(如D:\123\fgh.skf、D:\123\dfg.skf 、D:\123\ddd.skf)该如何设置路径,自己编辑几次不成功,请高手帮助编辑一下
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)
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 |
|