#include <GuiListView.au3>
#include <WindowsConstants.au3>
$Path = @ScriptDir & '\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