找回密码
 加入
搜索
查看: 8786|回复: 16

[GUI管理] [已解决]如何用.she做皮肤?

 火.. [复制链接]
发表于 2010-8-4 10:53:13 | 显示全部楼层 |阅读模式
本帖最后由 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金钱 +10 收起 理由
afan + 10 “已成功”改为“已解决”吧

查看全部评分

 楼主| 发表于 2010-8-4 10:58:27 | 显示全部楼层
回复 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
发表于 2010-8-4 12:10:01 | 显示全部楼层
1#第12行掉了个“\”
$Dll = DllOpen(@TempDir & "\Skin.dll")
发表于 2010-8-4 13:01:48 | 显示全部楼层
本帖最后由 水木子 于 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

评分

参与人数 1金钱 +10 收起 理由
hzxymkb + 10 知错就改!加分!

查看全部评分

发表于 2010-8-4 13:15:56 | 显示全部楼层
是我的错,实在不好意思,我重新整理了下代码!
水木子 发表于 2010-8-4 13:01

都是中级会员了,这几十行代码就一处错误都看不出怪不了谁,是我就不好意思发贴提问了。
发表于 2010-8-4 13:33:27 | 显示全部楼层
回复 5# jinhao
话不能这样说,毕竟是我错误在先,误导了大家,非常抱歉!
 楼主| 发表于 2010-8-4 13:58:40 | 显示全部楼层
回复 3# afan
有马虎了!
 楼主| 发表于 2010-8-4 13:59:49 | 显示全部楼层
回复 4# 水木子
老大,千万别这么说!楼下的我没在意,但我现在确实脸红了!
发表于 2010-8-4 13:59:56 | 显示全部楼层
回复  afan
有马虎了!
newuser 发表于 2010-8-4 13:58



    你果真马虎…
发表于 2010-8-4 14:03:18 | 显示全部楼层
回复 8# newuser

我可不是老大,错误在我,非常抱歉!
解决了就好!大家共同学习吧!
 楼主| 发表于 2010-8-4 14:03:57 | 显示全部楼层
回复 5# jinhao
真不好意思!我水平真的有限,这不是谦虚!这和中级没关系,都是拖拖拉拉得来得!
不过上午确实着急其他事,算是个托词吧!也感谢你的批评,今后会继续努力!
发表于 2010-8-4 14:19:30 | 显示全部楼层
回复  jinhao
真不好意思!我水平真的有限,这不是谦虚!这和中级没关系,都是拖拖拉拉得来得!
不过上午确实 ...
newuser 发表于 2010-8-4 14:03

你的号为中级会员证明了一点,你已不是新手了,不应该犯初级的错误!
发表于 2010-8-4 14:23:05 | 显示全部楼层
你们几位有严重灌水嫌疑!
发表于 2010-8-5 15:08:27 | 显示全部楼层
aero.she这个发来玩玩呵呵
发表于 2011-11-4 18:05:44 | 显示全部楼层
出来帮忙下可以么
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-6-11 06:24 , Processed in 0.095523 second(s), 28 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表