[已解决]如何用.she做皮肤?
本帖最后由 newuser 于 2010-8-4 16:39 编辑不成功???#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
FileInstall("aero.she",@TempDir & "\aero.she")
FileInstall("Skin.dll",@TempDir & "\Skin.dll")
$skins=@TempDir & "\aero.she"
$Dll = DllOpen(@TempDir & "Skin.dll")
DllCall($Dll, "int", "SkinH_AttachEx", "str", $skins, "str", "mhgd")
DllCall($Dll, "int", "SkinH_SetAero", "int", 1)
$Form1 = GUICreate("test .she skin", 633, 454, 192, 114)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
回复 1# newuser
我重这个代码没有扒出来?实在整不动了!#include <GuiListView.au3>
#include <WindowsConstants.au3>
$Path = @ScriptDir & '\36款SkinSharp皮肤\'
$Form1 = GUICreate("皮肤预览", 470, 280)
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY");为1个已知的Windows消息代码自定义1个用户函数
$ListView1 = GUICtrlCreateListView("双击项目更换皮肤", 280, 5, 185, 250)
GUISetState(@SW_SHOW)
Read();读皮肤文件到列表框
Func Read()
$search = FileFindFirstFile($Path & '\*.she')
If $search = -1 Then
MsgBox(0, "错误", "没有文件/目录 匹配搜索")
Exit
EndIf
While 1
$file = FileFindNextFile($search)
If @error Then ExitLoop
GUICtrlCreateListViewItem($file, $ListView1)
WEnd
FileClose($search)
EndFunc ;==>Read
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case - 3
Exit
EndSwitch
WEnd
Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
Local $tNMTV, $iCode, $hItem, $i = 0
$tNMTV = DllStructCreate($tagNMTVDISPINFO, $ilParam)
$iCode = DllStructGetData($tNMTV, "Code")
$Index = _GUICtrlListView_GetSelectedIndices($ListView1)
If $iCode = $NM_DBLCLK And StringLen($Index) <> 0 Then Skin(_GUICtrlListView_GetItemText($ListView1, Number($Index)))
EndFunc ;==>WM_NOTIFY
Func Skin($She)
;$Dll = DllOpen(@scriptDir & "\Skin.dll")
$Dll = DllOpen("Skin.dll")
DllCall($Dll, "int", "SkinH_AttachEx", "str", $Path & $She, "str", "mhgd")
DllCall($Dll, "int", "SkinH_SetAero", "int", 1)
EndFunc ;==>Skin 1#第12行掉了个“\”
$Dll = DllOpen(@TempDir & "\Skin.dll") 本帖最后由 水木子 于 2010-8-4 13:06 编辑
是我的错,实在不好意思,我重新整理了下代码!#include <GuiListView.au3>
#include <WindowsConstants.au3>
$Path = @ScriptDir & '\Skin\';将she皮肤文件和Skin.dll文件 放在脚本同目录下 Skin文件夹里
GUICreate("皮肤预览", 470, 280)
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
$ListView1 = GUICtrlCreateListView("双击项目更换皮肤", 280, 5, 185, 250)
GUICtrlCreateInput("Input1", 40, 40, 100, 21)
GUICtrlCreateCombo("Combo1", 40, 100, 100, 25)
GUICtrlSetData(-1, "Combo2|Combo3|Combo4|Combo5|Combo6|Combo7|Combo8|Combo9|Combo10")
GUICtrlCreateButton("Button1", 30, 220, 75, 30, $WS_GROUP)
GUICtrlCreateButton("Button2", 180, 220, 75, 30, $WS_GROUP)
GUICtrlCreateCheckbox("Checkbox1", 150, 40, 80, 17)
GUICtrlCreateRadio("Radio1", 150, 100, 80, 17)
GUICtrlCreateProgress(40, 150, 200, 20)
GUICtrlSetData(-1, 50)
GUICtrlCreateGroup("Group1", 10, 10, 249, 193)
GUISetState()
Read()
Func Read()
$search = FileFindFirstFile($Path & '*.she')
If $search = -1 Then MsgBox(0, "错误", "没有文件/目录 匹配搜索")
While 1
$file = FileFindNextFile($search)
If @error Then ExitLoop
GUICtrlCreateListViewItem($file, $ListView1)
WEnd
FileClose($search)
EndFunc ;==>Read
Do
Until GUIGetMsg() = -3
Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
Local $tNMTV, $iCode, $hItem, $i = 0
$tNMTV = DllStructCreate($tagNMTVDISPINFO, $ilParam)
$iCode = DllStructGetData($tNMTV, "Code")
$Index = _GUICtrlListView_GetSelectedIndices($ListView1)
If $iCode = $NM_DBLCLK And StringLen($Index) <> 0 Then Skin(_GUICtrlListView_GetItemText($ListView1, Number($Index)))
EndFunc ;==>WM_NOTIFY
Func Skin($She)
$Dll = DllOpen($Path & 'Skin.dll')
DllCall($Dll, "int", "SkinH_AttachEx", "str", $Path & $She, "str", "mhgd")
DllCall($Dll, "int", "SkinH_SetAero", "int", 1)
EndFunc ;==>Skin 是我的错,实在不好意思,我重新整理了下代码!
水木子 发表于 2010-8-4 13:01 http://www.autoitx.com/images/common/back.gif
都是中级会员了,这几十行代码就一处错误都看不出怪不了谁,是我就不好意思发贴提问了。 回复 5# jinhao
话不能这样说,毕竟是我错误在先,误导了大家,非常抱歉!{:1_601:} 回复 3# afan
有马虎了! 回复 4# 水木子
老大,千万别这么说!楼下的我没在意,但我现在确实脸红了! 回复afan
有马虎了!
newuser 发表于 2010-8-4 13:58 http://www.autoitx.com/images/common/back.gif
你果真马虎… 回复 8# newuser
我可不是老大,错误在我,非常抱歉!
解决了就好!大家共同学习吧! 回复 5# jinhao
真不好意思!我水平真的有限,这不是谦虚!这和中级没关系,都是拖拖拉拉得来得!
不过上午确实着急其他事,算是个托词吧!也感谢你的批评,今后会继续努力! 回复jinhao
真不好意思!我水平真的有限,这不是谦虚!这和中级没关系,都是拖拖拉拉得来得!
不过上午确实 ...
newuser 发表于 2010-8-4 14:03 http://www.autoitx.com/images/common/back.gif
你的号为中级会员证明了一点,你已不是新手了,不应该犯初级的错误! 你们几位有严重灌水嫌疑! aero.she这个发来玩玩呵呵 出来帮忙下可以么
页:
[1]
2