找回密码
 加入
搜索
查看: 7832|回复: 11

[AU3基础] 请问如何浏览皮肤文件.skf?[已解决]

  [复制链接]
发表于 2010-5-5 13:57:35 | 显示全部楼层 |阅读模式
本帖最后由 newuser 于 2010-5-5 17:03 编辑

到现在还没有作个属于自己AU3的.SKF文件?该如何浏览他呢?如果用照片.JPG,如何把他转换成.skf格式呢?

评分

参与人数 1金钱 +10 收起 理由
afan + 10 感谢主动将修改帖子分类为[已解决],请继续 ...

查看全部评分

 楼主| 发表于 2010-5-5 14:40:31 | 显示全部楼层
回复 1# newuser
看似调用皮肤成功,可是如何将自己的照片作成皮肤文件呢?没有搜索到有关内容!
以下上成功调用代码.
#cs
学习制作皮肤
实践结果:换肤成功

第1步:将SkinCrafterDll.dll和皮肤文件LEDWidget.skf复制到程序所在目录---完成

第2步:在include头文件后插入如下代码:
         FileInstall("SkinCrafterDll.dll", @TempDir & "\SkinCrafterDll.dll", 1)
         FileInstall("LEDWidget.skf", @TempDir & "\LEDWidget.skf", 1)
         $Dll = DllOpen(@TempDir & "\SkinCrafterDll.dll")
                 
第3步:在#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 633, 450, 193, 125)后插入一行代码,注意:保持Form1前后一致
_SkinGUI(@TempDir & "\SkinCrafterDll.dll", @TempDir & "\LEDWidget.skf", $Form1)

第4步:1.将SkinCrafterDll.dll和皮肤文件LEDWidget.skf复制到程序所在目录
2.在include头文件后插入如下代码:
  FileInstall("SkinCrafterDll.dll", @TempDir & "\SkinCrafterDll.dll", 1)
   FileInstall("LEDWidget.skf", @TempDir & "\LEDWidget.skf", 1)
   $Dll = DllOpen(@TempDir & "\SkinCrafterDll.dll")
3.在#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 633, 450, 193, 125)后插入一行代码,注意:保持Form1前后一致
_SkinGUI(@TempDir & "\SkinCrafterDll.dll", @TempDir & "\LEDWidget.skf", $Form1)
4.在窗口函数代码段后插入如下代码:
  ;定义皮肤函数
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   ;==>_SkinGUI

;皮肤退出
Func Quit()
        GUISetState(@SW_HIDE)
        DllCall($Dll, "int:cdecl", "DeInitDecoration")
        DllCall($Dll, "int:cdecl", "RemoveSkin")
        DllClose($Dll)
        FileDelete(@TempDir & "\SkinCrafterDll.dll")
        FileDelete(@TempDir & "\LEDWidget.skf")
                Exit
EndFunc 

总结:第3和第4步可根据自己需要进行位置调整,如把皮肤文件变成$Group1的背景,即把第3和第4步的代码加入到$Group1代码后,只不过
      _SkinGUI(@TempDir & "\SkinCrafterDll.dll", @TempDir & "\LEDWidget.skf", $Form1)里的$Form1要变成$Group1了

问题1:我从机器中找到其它的.skf文件重新命名为LEDWidget.skf,执行后怎么有的有效果,有的没有效果?
我的答案:难道是文件自身的问题。

#ce

;事件响应版系统工具,不带密码验证

Opt("GUIOnEventMode",1) ;采用事件模式响应
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

FileInstall("SkinCrafterDll.dll", @TempDir & "\SkinCrafterDll.dll", 1)
FileInstall("LEDWidget.skf", @TempDir & "\LEDWidget.skf", 1)
$Dll = DllOpen(@TempDir & "\SkinCrafterDll.dll")


#Region ### START Koda GUI section ### Form=

$Form1 = GUICreate("系统工具集 ", 631, 454, 192, 114)

_SkinGUI(@TempDir & "\SkinCrafterDll.dll", @TempDir & "\LEDWidget.skf", $Form1)

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   ;==>_SkinGUI

;皮肤退出
Func Quit()
        GUISetState(@SW_HIDE)
        DllCall($Dll, "int:cdecl", "DeInitDecoration")
        DllCall($Dll, "int:cdecl", "RemoveSkin")
        DllClose($Dll)
        FileDelete(@TempDir & "\SkinCrafterDll.dll")
        FileDelete(@TempDir & "\LEDWidget.skf")
                Exit
EndFunc 


$Group1 = GUICtrlCreateGroup(".exe类", 48, 32, 169, 305)
$Button2 = GUICtrlCreateButton("Windows更新程序", 64, 56, 137, 33)
$Button3 = GUICtrlCreateButton("远程桌面", 64, 96, 137, 33)
$Button4 = GUICtrlCreateButton("系统信息", 64, 136, 137, 33)
$Button5 = GUICtrlCreateButton("文件签名验证程序", 64, 176, 137, 33)
$Button6 = GUICtrlCreateButton("任务管理器", 64, 216, 137, 33)
$Button7 = GUICtrlCreateButton("系统配置实用程序", 64, 256, 137, 33)
$Button8 = GUICtrlCreateButton("磁盘垃圾清理", 64, 296, 137, 33)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup(".msc类", 232, 32, 169, 305)
$Button9 = GUICtrlCreateButton("本地服务设置", 248, 56, 137, 33)
$Button10 = GUICtrlCreateButton("共享文件夹管理器", 248, 96, 137, 33)
$Button11 = GUICtrlCreateButton("磁盘碎片整理", 248, 136, 137, 33)
$Button12 = GUICtrlCreateButton("计算机管理", 248, 176, 137, 33)
$Button13 = GUICtrlCreateButton("磁盘管理", 248, 216, 137, 33)
$Button14 = GUICtrlCreateButton("本地安全设置", 248, 256, 137, 33)
$Button15 = GUICtrlCreateButton("设备管理器", 248, 296, 137, 33)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group3 = GUICtrlCreateGroup(".cpl类(控制面板)", 416, 32, 169, 305)
$Button16 = GUICtrlCreateButton("系统属性", 432, 56, 137, 33)
$Button17 = GUICtrlCreateButton("用户帐户", 432, 96, 137, 33)
$Button18 = GUICtrlCreateButton("自动更新", 432, 136, 137, 33)
$Button19 = GUICtrlCreateButton("网络连接", 432, 176, 137, 33)
$Button20 = GUICtrlCreateButton("区域和语言选项", 432, 216, 137, 33)
$Button21 = GUICtrlCreateButton("添加/删除程序", 432, 256, 137, 33)
$Button22 = GUICtrlCreateButton("Internet属性", 432, 296, 137, 33)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group4 = GUICtrlCreateGroup("以上工具也可通过运行执行", 48, 352, 537, 65)
$Input1 = GUICtrlCreateInput("", 64, 376, 337, 21)
$Button1 = GUICtrlCreateButton("运行", 416, 368, 105, 33)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Label1 = GUICtrlCreateLabel("感谢hynq2000!仅为练手使用---采十青青橄榄  2010.4.27", 216, 424, 320, 66)
$Group5 = GUICtrlCreateGroup("", 32, 20, 569, 455)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlSetState(-1, $GUI_DISABLE)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

;###########进行事件关联##############
GUISetOnEvent($gui_event_close,"_Exit") ;错误:将  $ 写成 @
GUICtrlSetOnEvent($Button2,"_SysTools") ;点击$Button2,函数_SysTools响应,注意,不需要书写_SysTools(),而且要用" "将函数括起来
GUICtrlSetOnEvent($Button3,"_SysTools") ;另外注意是GUICtrlSetOnEvent(),不是GUISetOnEvent(),人家可是控件啊 !
GUICtrlSetOnEvent($Button4,"_SysTools")
GUICtrlSetOnEvent($Button5,"_SysTools")
GUICtrlSetOnEvent($Button6,"_SysTools")
GUICtrlSetOnEvent($Button7,"_SysTools")
GUICtrlSetOnEvent($Button8,"_SysTools")
GUICtrlSetOnEvent($Button9,"_SysTools")
GUICtrlSetOnEvent($Button10,"_SysTools")
GUICtrlSetOnEvent($Button11,"_SysTools")
GUICtrlSetOnEvent($Button12,"_SysTools")
GUICtrlSetOnEvent($Button13,"_SysTools")
GUICtrlSetOnEvent($Button14,"_SysTools")
GUICtrlSetOnEvent($Button15,"_SysTools")
GUICtrlSetOnEvent($Button16,"_SysTools")
GUICtrlSetOnEvent($Button17,"_SysTools")
GUICtrlSetOnEvent($Button18,"_SysTools")
GUICtrlSetOnEvent($Button19,"_SysTools")
GUICtrlSetOnEvent($Button20,"_SysTools")
GUICtrlSetOnEvent($Button21,"_SysTools")
GUICtrlSetOnEvent($Button22,"_SysTools")
GUICtrlSetOnEvent($Button1,"_SysTools")
;###########事件关联完毕##############

;###########进入##############
;注意:没有这个循环,界面是一闪而过
While 1
        Sleep(1)
WEnd
;###########主循环完毕##############

;###########定义响应事件的函数##############
Func _SysTools()
        Switch @GUI_CtrlId ;这是事件模式,别忘了消息模式是 Switch @GUIGetMsg()
                Case $Button2 ;开始执行系统的exe文件,一般它们都在  \system32目录下
                        Run(@SystemDir&"\wupdmgr.exe") 
                Case $Button3
                        Run(@SystemDir&"\mstsc.exe")
                Case $Button4
                        Run(@SystemDir&"\winmsd.exe")
                Case $Button5
                        Run(@SystemDir&"\sigverif.exe")
                Case $Button6
                        Run(@SystemDir&"\taskmgr.exe")
                Case $Button7
                        Run(@WindowsDir&"\pchealth\helpctr\binaries\Msconfig.exe") ;msconfig命令不在\system32目录下
                        ;Run(@SystemDir&"\tsshutdn.exe") 它是60秒倒计时关机命令
                Case $Button8
                        Run(@SystemDir&"\cleanmgr.exe")
                Case $Button9 ;开始执行系统的msc文件,一般它们都在  \system32目录下,通过shellexecute执行它们
                        ShellExecute(@SystemDir&"\services.msc")
                Case $Button10
                        ShellExecute(@SystemDir&"\fsmgmt.msc")
                Case $Button11
                        ShellExecute(@SystemDir&"\dfrg.msc")
                Case $Button12
                    ShellExecute(@SystemDir&"\compmgmt.msc")
                Case $Button13
                        ShellExecute(@SystemDir&"\diskmgmt.msc")
                Case $Button14
                        ShellExecute(@SystemDir&"\secpol.msc")
                Case $Button15
                        ShellExecute(@SystemDir&"\devmgmt.msc")
                Case $Button16 ;开始执行系统的cpl文件,一般它们都在  \system32目录下,通过control来执行.cpl文件
                        Run("control sysdm.cpl")
                Case $Button17
                        Run("control userpasswords2")
                        ;Run("control nusrmgr.cpl"),不知道为什么它不好使!
                Case $Button18
                        Run("control wuaucpl.cpl")
                Case $Button19
                        Run("control ncpa.cpl")
                Case $Button20
                        Run("control intl.cpl")
                Case $Button21
                        Run("control appwiz.cpl")
                Case $Button22
                        Run("control inetcpl.cpl")
                Case $Button1 ;执行 “运行” 按钮
                        Run('cmd /c'&GUICtrlRead($input1)) ;刚开始,$Button1就是没有反映,原来是忘记将其进行事件关联了
                        ;RunWait(@ComSpec&" /c "&GUICtrlRead($Input1)) ;参数  /c 表示要执行后面的“命令字符串”,而字符串是来自控件$input1内的内容
                        ;问题2:输入 msconfig 怎么不执行呢?
                        ;答:笨蛋!它不在/system32目录下,必须输入绝对路径才能执行,要不然再修改Path把msconfig所在的目录也加上
                        ;问题3:如何执行tasklist后让出现的窗口定住呢?Run('cmd /c pause')只是又打开一个DOS的暂停窗口啊?
                        ;答:其实在$input1内输入“tasklist & pause"就实现了,不过这还是DOS啊!
                        ;cmd /V:ON  启用“延迟变量”的意思!
        EndSwitch
EndFunc

Func _Exit()
        Exit
EndFunc
 楼主| 发表于 2010-5-5 15:02:47 | 显示全部楼层
回复 2# newuser
这段代码更利于学习,但是我没有测试成功!
#Region ### START Koda GUI section ### Form=
        $Form1 = GUICreate("DrvT_2.6", 360, 256, -1, -1, BitOR($WS_CAPTION, $WS_POPUP), 0)
        _SkinGUI(@WindowsDir & "\temp\SkinCrafterDll.dll", @WindowsDir & "\temp\Flexi_ST.skf", $Form1)

。。。。。。。。。。。。。。
。。。。。。。。。。。。
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
                                            Exit
        EndSwitch
WEnd

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  ;==>_SkinGUI
发表于 2010-5-5 15:51:19 | 显示全部楼层
回复 1# newuser


    http://www.autoitx.com/thread-13164-1-1.html
论坛里面就有 搜索一下嘛
 楼主| 发表于 2010-5-5 16:37:54 | 显示全部楼层
回复 4# guland
谢谢!我下载学习!
 楼主| 发表于 2010-5-5 17:02:38 | 显示全部楼层
回复 1# newuser
原来使用皮肤制作工具查看,不过谁有这方面的教程啊!不会用啊!
发表于 2010-6-20 21:08:01 | 显示全部楼层
有没有大虾写点详细的东东,俺这菜菜鸟不懂
发表于 2010-8-29 00:21:35 | 显示全部楼层
虽然看得不是很明。。还是顶一下。
发表于 2011-2-8 14:04:44 | 显示全部楼层
正在学习中
发表于 2011-2-10 15:32:40 | 显示全部楼层
学习了    这个好玩
发表于 2011-3-21 04:51:05 | 显示全部楼层
学习了    这个好玩
发表于 2011-5-17 11:08:11 | 显示全部楼层
太精彩了!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-10-2 03:34 , Processed in 0.076329 second(s), 21 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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