回复 4# dnvplj
复制你的代码,直接F5,发生无数错误,我都懒得搞了~~
贴两个我自己的
skf格式的
;======================= 装入到编译后的文件 ========================================
FileInstall(".\SkinCrafterDll.dll",@TempDir&"SkinCrafterDll.dll",1)
FileInstall(".\skin.skf",@TempDir&"skin.skf",1)
;===================================================================================
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("华哥最帅!!", 443, 254, 192, 124)
Global $Dll ;增加本行
_SkinGUI(@TempDir&"SkinCrafterDll.dll", @TempDir&"skin.skf", $Form1) ;增加本行,按本行格式改变创建窗体的赋值名称(这里是$Form1)即可
$Button1 = GUICtrlCreateButton("按钮1", 32, 32, 89, 33)
$Radio1 = GUICtrlCreateRadio("Radio1", 200, 32, 97, 33)
$List1 = GUICtrlCreateList("", 200, 88, 105, 32)
$Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 296, 40, 97, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Quit() ;改成这个函数,用于退出时卸载皮肤
Case $Button1
MsgBox(0,'','测试信息!!')
EndSwitch
WEnd
;调用皮肤函数,直接复制即可(包括下面的退出函数),所有的脚本只要将皮肤及闪屏文件改成:skin.skf即可调用成功
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)
FileDelete(@TempDir&"SkinCrafterDll.dll")
FileDelete(@TempDir&"skin.skf")
Exit
EndFunc
she格式
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#PRE_Outfile=..\..\桌面\222.exe
#PRE_Res_requestedExecutionLevel=None
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
;我的SHE皮肤
#NoTrayIcon
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Global $Dll
FileInstall('skin.dll',@ProgramFilesDir&'\skin.dll')
FileInstall('浅蓝(默认).she',@ProgramFilesDir&'\浅蓝(默认).she') ;要使用皮肤,需要将文件名改成"skin",或者使------------------------------------------- ****注意:au3没有filerename()函数,请使用,filemove()来重命名!******
#Region ### START Koda GUI section ### Form= ;; |将这三个文件名改成你皮肤的文件名
Global $dllpath=@ProgramFilesDir&'\skin.dll',$She=@ProgramFilesDir&'\浅蓝(默认).she' ;这种调用皮肤的方法只要加上这些有注释的行就可以 ------------|
$Form1 = GUICreate(" 华哥最帅!!", 287, 200, 192, 114)
Skin($She) ;加这行,调用
$Label1 = GUICtrlCreateLabel("风云第一刀", 0, 8, 146, 41)
GUICtrlSetFont(-1, 16, 400, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
$Checkbox1 = GUICtrlCreateCheckbox("GOOD", 176, 8, 65, 25)
$Radio1 = GUICtrlCreateRadio("雷迪奥", 176, 48, 65, 33)
$List1 = GUICtrlCreateList("", 8, 64, 81, 32)
$Combo1 = GUICtrlCreateCombo("Combo1", 96, 64, 65, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
$Button1 = GUICtrlCreateButton("弹出看看!!", 80, 128, 81, 25)
GUISetState(@SW_SHOW)
;加入下面这个函数
Func Skin($She)
$Dll = DllOpen($dllpath)
DllCall($Dll, "int", "SkinH_AttachEx", "str", $She, "str", "mhgd")
DllCall($Dll, "int", "SkinH_SetAero", "int", 1)
EndFunc ;==>Skin
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
GUIDelete($Form1)
DllClose($Dll)
FileDelete($dllpath)
Exit
Case $Button1
MsgBox(0,'','好的!!')
EndSwitch
WEnd
|