#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_outfile=C:\Documents and Settings\Administrator\桌面\test4.exe
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#cs ____________________________________
脚本目的:利用.SKF换肤窗口
准备工作:
1.必须文件:皮肤文件.skf和SkinCrafterDll.dll;
2. 辅助文件SkinBuilder:主要用于查看.skf具体效果;
窗口换肤过程:
1.fileinstall()所需文件;
2.DllOpen()打开SkinCrafterDll.dll库文件以供DllCall()函数使用;
3.利用_SkinGUI()函数完成窗口更换皮肤。
注意事项:
1。注意用fileinstall()载入文件的源路径必须是字符不能有变量;
2.注意路径“\”符号必须存在,否则因路径导致无法找到更换皮肤所需文件;
3.注意退出时将载入文件删除。
特色:
1.通过样式BitOR($WS_SYSMENU, $WS_POPUP, $WS_POPUPWINDOW, $WS_BORDER), $WS_EX_TOOLWINDOW的使用将窗口3个最大(小)话按钮拿掉;
2.通过DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $Form1, "int", 450, "long", 0x00050010)实现退出窗口逐渐隐去效果
3.创建TAB加样式 ,$TCS_VERTICAL,就竖排显示,但必须#include <TabConstants.au3>的支持
指定显示TabItem用GUICtrlSetState(-1,$GUI_SHOW)
4.学会利用GUICtrlCreateLabel()创建横线和竖线,样式分别为$SS_ETCHEDHORZ和$SS_ETCHEDVERT
5.增加计算机配置信息显示-2010.8.3
#ce _______________脚本开始_________________
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#include <EditConstants.au3>
#include <IE.au3>
#Region ### START Koda GUI section ### Form=
FileInstall("SkinCrafterDll.dll",@TempDir & "\SkinCrafterDll.dll")
FileInstall("Cambodia.skf",@TempDir & "\Cambodia.skf");利用fileinstall()完成换肤所需文件的栽入
$Dll = DllOpen(@TempDir & "\SkinCrafterDll.dll");利用DllOpen()打开SkinCrafterDll.dll供DllCall()函数使用
$Form1 = GUICreate("Form1", 650, 454, 190, 137,BitOR($WS_SYSMENU, $WS_POPUP, $WS_POPUPWINDOW, $WS_BORDER), $WS_EX_TOOLWINDOW)
_SkinGUI(@TempDir & "\SkinCrafterDll.dll", @TempDir & "\Cambodia.skf", $Form1)
;利用_SkinGUI()函数实现窗口$Form1换肤
GUICtrlCreateLabel("",9,56,630,1,$SS_ETCHEDHORZ) ;创建1条横线
$Tab1 = GUICtrlCreateTab(11, 71, 558, 270)
$TabSheet1 = GUICtrlCreateTabItem("常见故障")
GUICtrlSetState(-1,$GUI_SHOW);TabItem很多,该语句就是打开窗口显示指定的TabItem
$TabSheet2 = GUICtrlCreateTabItem("系统优化")
$tab5list1 = GUICtrlCreateListView("", 15, 95, 360, 240)
_GUICtrlListView_SetExtendedListViewStyle($tab5list1, BitOR($LVS_EX_DOUBLEBUFFER, $LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES, $LVS_EX_CHECKBOXES, $LVS_EX_SUBITEMIMAGES))
$TabSheet3 = GUICtrlCreateTabItem("补丁管理")
$TabSheet4 = GUICtrlCreateTabItem("启动管理")
$TabSheet5 = GUICtrlCreateTabItem("程序管理")
;***********以下是$TabSheet6的具体实现,需要#include <IE.au3>支持
$TabSheet6 = GUICtrlCreateTabItem("控制面版")
_IEErrorHandlerRegister ()
$oIE = _IECreateEmbedded ()
If FileExists(@WindowsDir & "\Temp\ControlPanel.{21EC2020-3AEA-1069-A2DD-08002B30309D}") = 0 Then
DirCreate (@WindowsDir & "\Temp\ControlPanel.{21EC2020-3AEA-1069-A2DD-08002B30309D}")
EndIf
$Obj = GUICtrlCreateObj($oIE, 12, 90, 550, 260)
_IENavigate($oIE, "file:///C:\WINDOWS\Temp\ControlPanel.{21EC2020-3AEA-1069-A2DD-08002B30309D}",0)
;***********以下是$TabSheet6的结束
GUICtrlCreateTabItem("")
$Group1 = GUICtrlCreateGroup("",10, 64, 561, 400);这里组没什么用,就是为了修饰
GUICtrlCreateGroup("", -99, -99, 1, 1)
$UpdateIcon=GUICtrlCreateIcon("shell32.dll",-47,575,72)
$Update = GUICtrlCreateLabel("升级", 615, 87, 28, 17)
$AboutIcon=GUICtrlCreateIcon("shell32.dll",-161,575,120)
$AboutMe = GUICtrlCreateLabel("关于", 614, 133, 28, 17)
$ExitIcon=GUICtrlCreateIcon("shell32.dll",-216,575,168)
$Exit = GUICtrlCreateLabel("退出", 615, 180, 28, 17)
;$Icon1 = GUICtrlCreateIcon("D:\zgk_2010\autoit\excises\skin_excise\10.64.10.230.ico", -1, 24, 16, 33, 17)
$Icon1=GUICtrlCreateIcon("shell32.dll",-131,24,16)
GUICtrlCreateLabel("Windows辅助小助手", 62, 20, 260, 30)
GUICtrlSetColor(-1, 0xff0001)
GUICtrlSetFont(-1, 15, 400, 2,"Comic Sans MS")
;以下是计算机配置信息显示
;提示$ES_AUTOVSCROLL变量使用前未声明使用#include <EditConstants.au3>
$reginfo = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "ProductId")
;$Edit1 = GUICtrlCreateEdit("", 11, 342, 558, 120, BitOR($ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_READONLY, $ES_WANTRETURN, $ES_AUTOVSCROLL, $ES_AUTOHSCROLL), 0)
$Edit1 = GUICtrlCreateEdit("", 15, 342, 550, 80,0,0)
GUICtrlSetData($Edit1, @CRLF & " 以下是您的电脑配置信息:" & @CRLF & _
@CRLF &" 操作系统:" & @OSVersion & " " & @OSServicePack & " ,内部版本号: " & @OSBuild & _
@CRLF & " 计算机名称:" & @ComputerName & " ,当前用户名:" & @UserName & _
@CRLF & " 第一块网卡的IP地址:" & @IPAddress1 & " ,注册信息:" & $reginfo)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 15
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Exit
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $Form1, "int", 450, "long", 0x00050010)
GUIDelete($Form1)
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