#Region ACN预处理程序参数(常用参数)
#PRE_Icon= ;图标,支持EXE,DLL,ICO
#PRE_OutFile= ;输出文件名
#PRE_OutFile_Type=exe ;文件类型
#PRE_Compression=4 ;压缩等级
#PRE_UseUpx=y ;使用压缩
#PRE_Res_Comment= ;程序注释
#PRE_Res_Description= ;详细信息
#PRE_Res_Fileversion= ;文件版本
#PRE_Res_FileVersion_AutoIncrement=p ;自动更新版本
#PRE_Res_LegalCopyright= ;版权
#PRE_Change2CUI=N ;修改输出的程序为CUI(控制台程序)
;#PRE_Res_Field=AutoIt Version|%AutoItVer% ;自定义资源段
;#PRE_Run_Tidy= ;脚本整理
;#PRE_Run_Obfuscator= ;代码迷惑
;#PRE_Run_AU3Check= ;语法检查
;#PRE_Run_Before= ;运行前
;#PRE_Run_After= ;运行后
;#PRE_UseX64=n ;使用64位解释器
;#PRE_Compile_Both ;进行双平台编译
#EndRegion ACN预处理程序参数(常用参数)
#cs ____________________________________
Au3 版本:
脚本作者:
电子邮件:
QQ/TM:
脚本版本:
脚本功能:
#ce _______________脚本开始_________________
#include <Constants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <GDIPlusEx.au3>
#include <Thread.au3>
Opt('GUIOnEventMode', 1)
_RTEmptyWorkingSet();Thread.au3里的函数,减少内存占用的
Global $zhuwidth = 600, $zhuheight = 400, $winround = 10;主窗口的“宽和高”的设置
Global $pifucolor[5] = [0xFF0860a8, 0xFFFFAA00, 0xFF00AAFF, 0xFF990000, 0xFF009a20], $pifu = 0;皮肤颜色
Global $imgpifu[6] = ["", @ScriptDir & "\top\1.jpg", @ScriptDir & "\top\2.jpg", @ScriptDir & "\top\3.jpg", @ScriptDir & "\top\4.jpg", @ScriptDir & "\top\5.jpg"], $imgNum = 0
;以上几个 .jpg 是设置窗口“顶端背景”的,但我没测试出来?
;原来是通过”设置“菜单实现”换肤“的,竟然没注意到!
_GDIPlus_Startup()
Global $PanBtnRect[7], $SelectPanBtn = 1, $OnPanBtnNum = 0, $OnPanBtnFlag = 0
Global $topbutton[7], $topbuttonhoverimg[7], $topbuttondownimg[7], $topbuttontip[7], $onTopbuttonFlag = 0, $onTopbuttonNum = 0, $DownTopbuttonNum = 0
_initRect();应该是”初始化GUI右上角各个菜单的函数,如 皮肤、设置、反馈、最大(小)化、关闭
Global $zhu_gui = GUICreate("360界面预览", $zhuwidth, $zhuheight, -1, -1, $WS_POPUP, $WS_EX_LAYERED);创建主窗口
GUIRegisterMsg($WM_NCHITTEST, 'WM_NCHITTEST');为一个已知的Windows消息代码“$WM_NCHITTEST"注册一个用户自定义函数"WM_NCHITTEST"
GUIRegisterMsg($WM_LBUTTONDOWN, 'WM_LBUTTONDOWN')
GUIRegisterMsg($WM_LBUTTONUP, 'WM_LBUTTONUP')
$ne_gui = GUICreate("", $zhuwidth - 10, 260, 8, 110, $WS_POPUP, $WS_EX_MDICHILD, $zhu_gui)
;为主窗口$zhu_gui创建一个子窗口$ne_gui
$mylabel = GUICtrlCreateLabel("第一页", 10, 10, $zhuwidth - 20, 30)
GUICtrlSetFont(-1, 24)
GUICtrlSetColor(-1, 0x0860a8)
GUISetState(@SW_SHOW, $ne_gui)
GUISetState(@SW_SHOW, $zhu_gui)
_hoverBTN($SelectPanBtn, $OnPanBtnNum)
While 1
Sleep(100)
WEnd
Func exitfunc();退出函数
_GDIPlus_Shutdown()
Exit
EndFunc ;==>exitfunc
Func _initRect();应该是”初始化GUI右上角各个菜单的函数,如 皮肤、设置、反馈、最大(小)化、关闭
For $iI = 1 To 7
$PanBtnRect[$iI - 1] = DllStructCreate($tagRECT)
;创建一个 C/C++ 样式的数据结构供 DllCall 使用.
;DllStructCreate ( "数据结构" [,指针] )
DllStructSetData($PanBtnRect[$iI - 1], 1, 10 + ($iI - 1) * 70)
DllStructSetData($PanBtnRect[$iI - 1], 2, 30)
DllStructSetData($PanBtnRect[$iI - 1], 3, $iI * 70)
DllStructSetData($PanBtnRect[$iI - 1], 4, 90)
Next
Local $kzImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\top\TopPanelBtnClose.png");加载GUI右上角那个“ X” Image图象
$mybtnx = $zhuwidth - 2 - _GDIPlus_ImageGetWidth($kzImage)
$topbutton[0] = DllStructCreate($tagRECT)
DllStructSetData($topbutton[0], 1, $mybtnx)
DllStructSetData($topbutton[0], 2, 1)
DllStructSetData($topbutton[0], 3, $mybtnx + _GDIPlus_ImageGetWidth($kzImage))
DllStructSetData($topbutton[0], 4, _GDIPlus_ImageGetHeight($kzImage) + 1)
$topbuttonhoverimg[0] = @ScriptDir & "\top\TopPanelCloseOver.png"
;当鼠标”移动“到GUI右上角那个“ X” Image图象 “上(over)时",所显示的 Image 图象
$topbuttondownimg[0] = @ScriptDir & "\top\TopPanelCloseDown.png"
;当鼠标”点击“到GUI右上角那个“ X” Image图象 “上(down)时",所显示的 Image 图象
$topbuttontip[0] = "关闭程序"
;当鼠标”移动“到GUI右上角那个“ X” Image图象时,所显示的”提示文字“
$kzImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\top\TopPanelBtnMax.png")
$mybtnx -= _GDIPlus_ImageGetWidth($kzImage)
$topbutton[1] = DllStructCreate($tagRECT)
DllStructSetData($topbutton[1], 1, $mybtnx + 2)
DllStructSetData($topbutton[1], 2, 1)
DllStructSetData($topbutton[1], 3, $mybtnx + _GDIPlus_ImageGetWidth($kzImage))
DllStructSetData($topbutton[1], 4, _GDIPlus_ImageGetHeight($kzImage) + 1)
$topbuttonhoverimg[1] = @ScriptDir & "\top\MiddleOver.png"
$topbuttondownimg[1] = @ScriptDir & "\top\MiddleDown.png"
$topbuttontip[1] = "最大化"
$kzImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\top\TopPanelBtnMin.png")
$mybtnx -= _GDIPlus_ImageGetWidth($kzImage)
$topbutton[2] = DllStructCreate($tagRECT)
DllStructSetData($topbutton[2], 1, $mybtnx + 2)
DllStructSetData($topbutton[2], 2, 1)
DllStructSetData($topbutton[2], 3, $mybtnx + _GDIPlus_ImageGetWidth($kzImage))
DllStructSetData($topbutton[2], 4, _GDIPlus_ImageGetHeight($kzImage) + 1)
$topbuttonhoverimg[2] = @ScriptDir & "\top\MiddleOver.png"
$topbuttondownimg[2] = @ScriptDir & "\top\MiddleDown.png"
$topbuttontip[2] = "最小化"
$kzImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\top\TopPanelBtnSetting.png")
$mybtnx -= _GDIPlus_ImageGetWidth($kzImage)
$topbutton[3] = DllStructCreate($tagRECT)
DllStructSetData($topbutton[3], 1, $mybtnx + 2)
DllStructSetData($topbutton[3], 2, 1)
DllStructSetData($topbutton[3], 3, $mybtnx + _GDIPlus_ImageGetWidth($kzImage))
DllStructSetData($topbutton[3], 4, _GDIPlus_ImageGetHeight($kzImage) + 1)
$topbuttonhoverimg[3] = @ScriptDir & "\top\MiddleOver.png"
$topbuttondownimg[3] = @ScriptDir & "\top\MiddleDown.png"
$topbuttontip[3] = "设置"
$kzImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\top\TopPanelBtnFeedback.png")
$mybtnx -= _GDIPlus_ImageGetWidth($kzImage)
$topbutton[4] = DllStructCreate($tagRECT)
DllStructSetData($topbutton[4], 1, $mybtnx)
DllStructSetData($topbutton[4], 2, 1)
DllStructSetData($topbutton[4], 3, $mybtnx + _GDIPlus_ImageGetWidth($kzImage))
DllStructSetData($topbutton[4], 4, _GDIPlus_ImageGetHeight($kzImage) + 1)
$topbuttonhoverimg[4] = @ScriptDir & "\top\over.png"
$topbuttondownimg[4] = @ScriptDir & "\top\mask.png"
$topbuttontip[4] = "反馈"
$kzImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\top\skin.png")
$mybtnx -= _GDIPlus_ImageGetWidth($kzImage)
$topbutton[5] = DllStructCreate($tagRECT)
DllStructSetData($topbutton[5], 1, $mybtnx)
DllStructSetData($topbutton[5], 2, 1)
DllStructSetData($topbutton[5], 3, $mybtnx + _GDIPlus_ImageGetWidth($kzImage))
DllStructSetData($topbutton[5], 4, _GDIPlus_ImageGetHeight($kzImage) + 1)
$topbuttonhoverimg[5] = @ScriptDir & "\top\over.png"
$topbuttondownimg[5] = @ScriptDir & "\top\mask.png"
$topbuttontip[5] = "皮肤"
$kzImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\top\TopPanelBtnSkin.png")
$mybtnx = $zhuwidth - 20 - _GDIPlus_ImageGetWidth($kzImage)
$topbutton[6] = DllStructCreate($tagRECT)
DllStructSetData($topbutton[6], 1, $mybtnx)
DllStructSetData($topbutton[6], 2, 30)
DllStructSetData($topbutton[6], 3, $mybtnx + _GDIPlus_ImageGetWidth($kzImage))
DllStructSetData($topbutton[6], 4, _GDIPlus_ImageGetHeight($kzImage) + 30)
$topbuttonhoverimg[6] = @ScriptDir & "\top\over.png"
$topbuttondownimg[6] = @ScriptDir & "\top\mask.png"
$topbuttontip[6] = "配色"
_GDIPlus_ImageDispose($kzImage);释放一个图象对象
EndFunc ;==>_initRect
Func _myback($mywidth, $myheight, $mycolor = 0xFF0860a8, $myskin = "", $myround = 10, $myleftup = True, $myrightup = True, $myleftdown = True, $myrightdown = True)
Local $hHBITMAP = _WinAPI_CreateBitmap($mywidth, $myheight, 1, 32)
Local $hCDC = _WinAPI_CreateCompatibleDC(0)
Local $hOld = _WinAPI_SelectObject($hCDC, $hHBITMAP)
Local $hGraphic = _GDIPlus_GraphicsCreateFromHDC($hCDC)
_GDIPlus_GraphicsClear($hGraphic, 0x00000000)
_GDIPlus_GraphicsSetSmoothingMode($hGraphic, 2);绘制质量 2 - 使用 8 X 8 矩形过滤器
_GDIPlus_GraphicsSetInterpolationMode($hGraphic, 7);插值法 7=High-quality, bicubic interpolation.
$hPath = _myPath(0, 0, $mywidth, $myheight)
$hPen = _GDIPlus_PenCreate(0xFF000000, 1, 0)
_GDIPlus_PenSetLineJoin($hPen, 2);2 - Line join produces a smooth, circular arc between the lines.
DllCall($ghGDIPDll, "uint", "GdipDrawPath", "hwnd", $hGraphic, "hwnd", $hPen, "hwnd", $hPath)
If $myskin = "" Then
Local $tRect = _GDIPlus_RectFCreate(0, 0, 40, $myheight);设置区域色块
Local $hBrush = _GDIPlus_LineBrushCreateFromRect($tRect, 0xaaffffff, $mycolor, 1, 3)
Local $tBlends[5][2]
$tBlends[0][0] = 4
$tBlends[1][0] = 0.05
$tBlends[1][1] = 0.0
$tBlends[2][0] = 1
$tBlends[2][1] = 0.05
$tBlends[3][0] = 0.9
$tBlends[3][1] = 0.9
$tBlends[4][0] = 1
$tBlends[4][1] = 1.0
_GDIPlus_LineBrushSetBlend($hBrush, $tBlends)
DllCall($ghGDIPDll, "uint", "GdipFillPath", "hwnd", $hGraphic, "hwnd", $hBrush, "hwnd", $hPath)
_GDIPlus_BrushDispose($hBrush)
Else
Local $kzImage = _GDIPlus_ImageLoadFromFile($myskin)
Local $imgwidth = $mywidth
If _GDIPlus_ImageGetWidth($kzImage) < $mywidth Then $imgwidth = _GDIPlus_ImageGetWidth($kzImage)
Local $imgheight = $myheight
If _GDIPlus_ImageGetHeight($kzImage) < $myheight Then $imgheight = _GDIPlus_ImageGetHeight($kzImage)
$mypictexture = _GDIPlus_TextureCreate2($kzImage, 0, 0, $imgwidth, $imgheight, 3)
DllCall($ghGDIPDll, "uint", "GdipFillPath", "hwnd", $hGraphic, "hwnd", $mypictexture, "hwnd", $hPath)
_GDIPlus_BrushDispose($mypictexture)
EndIf
_GDIPlus_PathDispose($hPath)
_GDIPlus_PenDispose($hPen)
Local $kzImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\top\TopPanelBtnClose.png")
$mybtnx = $mywidth - 2 - _GDIPlus_ImageGetWidth($kzImage)
_GDIPlus_GraphicsDrawImageRectRect($hGraphic, $kzImage, 0, 0, _GDIPlus_ImageGetWidth($kzImage), _GDIPlus_ImageGetHeight($kzImage), $mybtnx, 1, _GDIPlus_ImageGetWidth($kzImage), _GDIPlus_ImageGetHeight($kzImage))
$kzImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\top\TopPanelBtnMax.png")
$mybtnx -= _GDIPlus_ImageGetWidth($kzImage)
_GDIPlus_GraphicsDrawImageRectRect($hGraphic, $kzImage, 0, 0, _GDIPlus_ImageGetWidth($kzImage), _GDIPlus_ImageGetHeight($kzImage), $mybtnx, 1, _GDIPlus_ImageGetWidth($kzImage), _GDIPlus_ImageGetHeight($kzImage))
$kzImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\top\TopPanelBtnMin.png")
$mybtnx -= _GDIPlus_ImageGetWidth($kzImage)
_GDIPlus_GraphicsDrawImageRectRect($hGraphic, $kzImage, 0, 0, _GDIPlus_ImageGetWidth($kzImage), _GDIPlus_ImageGetHeight($kzImage), $mybtnx, 1, _GDIPlus_ImageGetWidth($kzImage), _GDIPlus_ImageGetHeight($kzImage))
$kzImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\top\TopPanelBtnSetting.png")
$mybtnx -= _GDIPlus_ImageGetWidth($kzImage)
_GDIPlus_GraphicsDrawImageRectRect($hGraphic, $kzImage, 0, 0, _GDIPlus_ImageGetWidth($kzImage), _GDIPlus_ImageGetHeight($kzImage), $mybtnx, 1, _GDIPlus_ImageGetWidth($kzImage), _GDIPlus_ImageGetHeight($kzImage))
$kzImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\top\TopPanelBtnFeedback.png")
$mybtnx -= _GDIPlus_ImageGetWidth($kzImage)
_GDIPlus_GraphicsDrawImageRectRect($hGraphic, $kzImage, 0, 0, _GDIPlus_ImageGetWidth($kzImage), _GDIPlus_ImageGetHeight($kzImage), $mybtnx, 1, _GDIPlus_ImageGetWidth($kzImage), _GDIPlus_ImageGetHeight($kzImage))
$kzImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\top\skin.png")
$mybtnx -= _GDIPlus_ImageGetWidth($kzImage)
_GDIPlus_GraphicsDrawImageRectRect($hGraphic, $kzImage, 0, 0, _GDIPlus_ImageGetWidth($kzImage), _GDIPlus_ImageGetHeight($kzImage), $mybtnx + 1, 2, _GDIPlus_ImageGetWidth($kzImage), _GDIPlus_ImageGetHeight($kzImage))
$kzImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\top\TopPanelBtnSkin.png")
$mybtnx = $mywidth - 20 - _GDIPlus_ImageGetWidth($kzImage)
_GDIPlus_GraphicsDrawImageRectRect($hGraphic, $kzImage, 0, 0, _GDIPlus_ImageGetWidth($kzImage), _GDIPlus_ImageGetHeight($kzImage), $mybtnx, 30, _GDIPlus_ImageGetWidth($kzImage), _GDIPlus_ImageGetHeight($kzImage))
_GDIPlus_ImageDispose($kzImage)
$hFamily = _GDIPlus_FontFamilyCreate("黑体")
$hBrush = _GDIPlus_BrushCreateSolid(0xFFFFFFFF)
$tLayout = _GDIPlus_RectFCreate(5, 5)
$hPath = _GDIPlus_PathCreate()
_GDIPlus_PathAddString($hPath, "250流氓软件", $tLayout, $hFamily, 1, 9, 0);读取字体外形为路径;0是正常字,9是字号
;设置窗口标题
DllCall($ghGDIPDll, "uint", "GdipFillPath", "hwnd", $hGraphic, "hwnd", $hBrush, "hwnd", $hPath)
_GDIPlus_PathDispose($hPath)
$hPath = _GDIPlus_PathCreate()
$tLayout = _GDIPlus_RectFCreate(5, $myheight - 25)
_GDIPlus_PathAddString($hPath, "沙子制作 By seniors 2011", $tLayout, $hFamily, 0, 12, 0);读取字体外形为路径;0是正常字,16是字号
;设置任务栏”提示内容“
DllCall($ghGDIPDll, "uint", "GdipFillPath", "hwnd", $hGraphic, "hwnd", $hBrush, "hwnd", $hPath)
_GDIPlus_PathDispose($hPath)
_GDIPlus_FontFamilyDispose($hFamily)
_GDIPlus_BrushDispose($hBrush)
_GDIPlus_GraphicsDispose($hGraphic)
_WinAPI_SelectObject($hCDC, $hOld)
_WinAPI_DeleteDC($hCDC)
Return $hHBITMAP
EndFunc ;==>_myback
Func _hoverBTN($i, $j)
Local $hHBITMAP = _myback($zhuwidth, $zhuheight, $pifucolor[$pifu], $imgpifu[$imgNum], $winround, True, True, True, True)
Local $hCDC = _WinAPI_CreateCompatibleDC(0)
Local $hOld = _WinAPI_SelectObject($hCDC, $hHBITMAP)
Local $hGraphic = _GDIPlus_GraphicsCreateFromHDC($hCDC)
$hPath = _myPath(8 + 70 * ($i - 1), 25, 66, 80, 5)
$hPen = _GDIPlus_PenCreate(0x33000000, 1, 0)
_GDIPlus_PenSetLineJoin($hPen, 2);2 - Line join produces a smooth, circular arc between the lines.
DllCall($ghGDIPDll, "uint", "GdipDrawPath", "hwnd", $hGraphic, "hwnd", $hPen, "hwnd", $hPath)
$hPath = _myPath(7 + 70 * ($i - 1), 24, 66, 80, 5)
$hPen = _GDIPlus_PenCreate(0x77FFFFFF, 1, 0)
_GDIPlus_PenSetLineJoin($hPen, 2);2 - Line join produces a smooth, circular arc between the lines.
DllCall($ghGDIPDll, "uint", "GdipDrawPath", "hwnd", $hGraphic, "hwnd", $hPen, "hwnd", $hPath)
$tRect = _GDIPlus_RectFCreate(0, 0, 70, 110);设置区域色块
$hBrush = _GDIPlus_LineBrushCreateFromRect($tRect, 0x99FFFFFF, 0x33FFFFFF, 1, 3)
Local $tBlends2[5][2]
$tBlends2[0][0] = 4
$tBlends2[1][0] = 0.01
$tBlends2[1][1] = 0.0
$tBlends2[2][0] = 0.1
$tBlends2[2][1] = 0.5
$tBlends2[3][0] = 1
$tBlends2[3][1] = 0.5
$tBlends2[4][0] = 1
$tBlends2[4][1] = 1.0
_GDIPlus_LineBrushSetBlend($hBrush, $tBlends2)
DllCall($ghGDIPDll, "uint", "GdipFillPath", "hwnd", $hGraphic, "hwnd", $hBrush, "hwnd", $hPath)
If $j <> 0 Then
$hPath = _myPath(8 + 70 * ($j - 1), 25, 66, 80, 5)
$hPen = _GDIPlus_PenCreate(0x22000000, 1, 0)
_GDIPlus_PenSetLineJoin($hPen, 2);2 - Line join produces a smooth, circular arc between the lines.
DllCall($ghGDIPDll, "uint", "GdipDrawPath", "hwnd", $hGraphic, "hwnd", $hPen, "hwnd", $hPath)
$hPath = _myPath(7 + 70 * ($j - 1), 24, 66, 80, 5)
$hPen = _GDIPlus_PenCreate(0x33FFFFFF, 1, 0)
_GDIPlus_PenSetLineJoin($hPen, 2);2 - Line join produces a smooth, circular arc between the lines.
DllCall($ghGDIPDll, "uint", "GdipDrawPath", "hwnd", $hGraphic, "hwnd", $hPen, "hwnd", $hPath)
$tRect = _GDIPlus_RectFCreate(0, 0, 70, 110);设置区域色块
$hBrush = _GDIPlus_LineBrushCreateFromRect($tRect, 0x55FFFFFF, 0x11FFFFFF, 1, 3)
Local $tBlends2[5][2]
$tBlends2[0][0] = 4
$tBlends2[1][0] = 0.01
$tBlends2[1][1] = 0.0
$tBlends2[2][0] = 0.1
$tBlends2[2][1] = 0.5
$tBlends2[3][0] = 1
$tBlends2[3][1] = 0.5
$tBlends2[4][0] = 1
$tBlends2[4][1] = 1.0
_GDIPlus_LineBrushSetBlend($hBrush, $tBlends2)
DllCall($ghGDIPDll, "uint", "GdipFillPath", "hwnd", $hGraphic, "hwnd", $hBrush, "hwnd", $hPath)
EndIf
_GDIPlus_PenDispose($hPen)
_GDIPlus_BrushDispose($hBrush)
For $iI = 1 To 7
$kzImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\app" & $iI & ".png");加载应用图象用的
_GDIPlus_GraphicsDrawImageRectRect($hGraphic, $kzImage, 0, 0, _GDIPlus_ImageGetWidth($kzImage), _GDIPlus_ImageGetHeight($kzImage), DllStructGetData($PanBtnRect[$iI - 1], 1), DllStructGetData($PanBtnRect[$iI - 1], 2), 70, 70)
Next
_GDIPlus_ImageDispose($kzImage)
_GDIPlus_GraphicsDispose($hGraphic)
_WinAPI_SelectObject($hCDC, $hOld)
_WinAPI_DeleteDC($hCDC)
_WinAPI_UpdateLayeredWindowEx($zhu_gui, $hHBITMAP, 255);可能3.3.7开始这个函数有改变,请在$hHBITMAP前加上二个参数-1,-1
Return $hHBITMAP
EndFunc ;==>_hoverBTN
Func _huanfu()
$pifu += 1
$imgNum = 0
If $pifu == UBound($pifucolor) Then $pifu = 0;UBound($pifucolor) 返回数组 $pifucolor的维度大小
_hoverBTN($SelectPanBtn, $OnPanBtnNum)
EndFunc ;==>_huanfu
Func _huanimg()
$imgNum += 1
If $imgNum == UBound($imgpifu) Then $imgNum = 1
_hoverBTN($SelectPanBtn, $OnPanBtnNum)
EndFunc ;==>_huanimg
Func _topbutton($btRect, $file)
Local $hHBITMAP = _hoverBTN($SelectPanBtn, $OnPanBtnNum)
Local $hCDC = _WinAPI_CreateCompatibleDC(0)
Local $hOld = _WinAPI_SelectObject($hCDC, $hHBITMAP)
Local $hGraphic = _GDIPlus_GraphicsCreateFromHDC($hCDC)
Local $kzImage = _GDIPlus_ImageLoadFromFile($file)
_GDIPlus_GraphicsDrawImageRectRect($hGraphic, $kzImage, 0, 0, _GDIPlus_ImageGetWidth($kzImage), _GDIPlus_ImageGetHeight($kzImage), DllStructGetData($btRect, 1), DllStructGetData($btRect, 2), _GDIPlus_ImageGetWidth($kzImage), _GDIPlus_ImageGetHeight($kzImage))
_GDIPlus_ImageDispose($kzImage)
_GDIPlus_GraphicsDispose($hGraphic)
_WinAPI_SelectObject($hCDC, $hOld)
_WinAPI_DeleteDC($hCDC)
_WinAPI_UpdateLayeredWindowEx($zhu_gui, $hHBITMAP, 255);可能3.3.7开始这个函数有改变,请在$hHBITMAP前加上二个参数-1,-1
Return $hHBITMAP
EndFunc ;==>_topbutton
Func WM_NCHITTEST($hWnd, $Msg, $wParam, $lParam)
Local $tPoint, $x, $y
$tPoint = _WinAPI_GetMousePos(True, $hWnd)
Switch $hWnd
Case $zhu_gui
$OnPanBtnFlag = 0
$onTopbuttonFlag = 0
For $iI = 1 To 6
If _WinAPI_PtInRect($PanBtnRect[$iI - 1], $tPoint) Then
$OnPanBtnFlag = $iI
ExitLoop
EndIf
Next
For $iI = 1 To 7
If _WinAPI_PtInRect($topbutton[$iI - 1], $tPoint) Then
$onTopbuttonFlag = $iI
ExitLoop
EndIf
Next
If $OnPanBtnFlag == 0 And $OnPanBtnNum <> $OnPanBtnFlag Then
$OnPanBtnNum = $OnPanBtnFlag
_hoverBTN($SelectPanBtn, $OnPanBtnNum)
ElseIf $onTopbuttonFlag == 0 And $onTopbuttonNum <> $onTopbuttonFlag Then
ToolTip("")
$onTopbuttonNum = $onTopbuttonFlag
_hoverBTN($SelectPanBtn, $OnPanBtnNum)
ElseIf $OnPanBtnFlag == 0 And $onTopbuttonFlag == 0 Then
Return $HTCAPTION
ElseIf $SelectPanBtn <> $OnPanBtnFlag And $OnPanBtnNum <> $OnPanBtnFlag Then
$OnPanBtnNum = $OnPanBtnFlag
$OnPanBtnFlag = 0
_hoverBTN($SelectPanBtn, $OnPanBtnNum)
Return $HTOBJECT
ElseIf $onTopbuttonFlag > 0 And $onTopbuttonNum <> $onTopbuttonFlag Then
$onTopbuttonNum = $onTopbuttonFlag
$onTopbuttonFlag = 0
_topbutton($topbutton[$onTopbuttonNum - 1], $topbuttonhoverimg[$onTopbuttonNum - 1])
Local $wrect = _WinAPI_GetWindowRect($zhu_gui)
ToolTip($topbuttontip[$onTopbuttonNum - 1], DllStructGetData($wrect, 1) + DllStructGetData($topbutton[$onTopbuttonNum - 1], 1), DllStructGetData($wrect, 2) + DllStructGetData($topbutton[$onTopbuttonNum - 1], 2) + 30)
Return $HTOBJECT
EndIf
EndSwitch
EndFunc ;==>WM_NCHITTEST
Func WM_LBUTTONDOWN($hWnd, $Msg, $wParam, $lParam)
Local $tPoint, $DownTopbuttonFlag, $DownPanBtnFlag
$tPoint = _WinAPI_GetMousePos(True, $hWnd)
Switch $hWnd
Case $zhu_gui
$DownPanBtnFlag = 0
$DownTopbuttonFlag = 0
For $iI = 1 To 6
If _WinAPI_PtInRect($PanBtnRect[$iI - 1], $tPoint) Then
$DownPanBtnFlag = $iI
ExitLoop
EndIf
Next
For $iI = 1 To 7
If _WinAPI_PtInRect($topbutton[$iI - 1], $tPoint) Then
$DownTopbuttonFlag = $iI
ExitLoop
EndIf
Next
Switch $DownPanBtnFlag
Case 1
If $SelectPanBtn <> $DownPanBtnFlag Then
$SelectPanBtn = $DownPanBtnFlag
_hoverBTN($SelectPanBtn, 0)
GUICtrlSetData($mylabel, "第一页")
EndIf
Case 2
If $SelectPanBtn <> $DownPanBtnFlag Then
$SelectPanBtn = $DownPanBtnFlag
_hoverBTN($SelectPanBtn, 0)
GUICtrlSetData($mylabel, "第二页")
EndIf
Case 3
If $SelectPanBtn <> $DownPanBtnFlag Then
$SelectPanBtn = $DownPanBtnFlag
_hoverBTN($SelectPanBtn, 0)
GUICtrlSetData($mylabel, "第三页")
EndIf
Case 4
If $SelectPanBtn <> $DownPanBtnFlag Then
$SelectPanBtn = $DownPanBtnFlag
_hoverBTN($SelectPanBtn, 0)
GUICtrlSetData($mylabel, "第四页")
EndIf
Case 5
If $SelectPanBtn <> $DownPanBtnFlag Then
$SelectPanBtn = $DownPanBtnFlag
_hoverBTN($SelectPanBtn, 0)
GUICtrlSetData($mylabel, "第五页")
EndIf
Case 6
If $SelectPanBtn <> $DownPanBtnFlag Then
$SelectPanBtn = $DownPanBtnFlag
_hoverBTN($SelectPanBtn, 0)
GUICtrlSetData($mylabel, "第六页")
EndIf
Case 7
If $SelectPanBtn <> $DownPanBtnFlag Then
$SelectPanBtn = $DownPanBtnFlag
_hoverBTN($SelectPanBtn, 0)
GUICtrlSetData($mylabel, "第七页")
EndIf
EndSwitch
Switch $DownTopbuttonFlag
Case 1 To 7
If $DownTopbuttonNum <> $DownTopbuttonFlag Then
$DownTopbuttonNum = $DownTopbuttonFlag
_topbutton($topbutton[$DownTopbuttonNum - 1], $topbuttondownimg[$DownTopbuttonNum - 1])
ToolTip("")
EndIf
EndSwitch
EndSwitch
EndFunc ;==>WM_LBUTTONDOWN
Func WM_LBUTTONUP($hWnd, $Msg, $wParam, $lParam)
Local $tPoint, $DownTopbuttonFlag
$tPoint = _WinAPI_GetMousePos(True, $hWnd)
Switch $hWnd
Case $zhu_gui
$DownTopbuttonFlag = 0
For $iI = 1 To 7
If _WinAPI_PtInRect($topbutton[$iI - 1], $tPoint) Then
$DownTopbuttonFlag = $iI
ExitLoop
EndIf
Next
Switch $DownTopbuttonFlag
Case 1
exitfunc()
Case 2
$DownTopbuttonNum = 0
_hoverBTN($SelectPanBtn, 0)
MsgBox(0, "", " 测试 ", 2, $zhu_gui)
Return
Case 3
$DownTopbuttonNum = 0
_hoverBTN($SelectPanBtn, 0)
GUISetState(@SW_MINIMIZE, $zhu_gui)
ToolTip("")
Return
Case 4
$DownTopbuttonNum = 0
_hoverBTN($SelectPanBtn, 0)
MsgBox(0, "", " 测试 ", 2, $zhu_gui)
Return
Case 5
$DownTopbuttonNum = 0
_hoverBTN($SelectPanBtn, 0)
ShellExecute("http://www.autoitx.com/thread-28704-1-1.html")
Return
Case 6
_huanimg()
$DownTopbuttonNum = 0
Return
Case 7
_huanfu()
$DownTopbuttonNum = 0
Return
EndSwitch
EndSwitch
EndFunc ;==>WM_LBUTTONUP
Func _myPath($myx, $myy, $mywidth, $myheight, $myround = 10, $myleftup = True, $myrightup = True, $myleftdown = True, $myrightdown = True)
Local $hPath = _GDIPlus_PathCreate()
If $myleftup Then
_GDIPlus_PathAddArc($hPath, $myx, $myy, $myround, $myround, 180, 90)
Else
_GDIPlus_PathAddLine($hPath, $myx, $myy, $myx, $myy)
EndIf
If $myrightup Then
_GDIPlus_PathAddArc($hPath, $myx + $mywidth - $myround - 1, $myy, $myround, $myround, 270, 90)
Else
_GDIPlus_PathAddLine($hPath, $myx + $mywidth - 1, $myy, $myx + $mywidth - 1, $myy)
EndIf
If $myrightdown Then
_GDIPlus_PathAddArc($hPath, $myx + $mywidth - $myround - 1, $myy + $myheight - $myround - 1, $myround, $myround, 0, 90)
Else
_GDIPlus_PathAddLine($hPath, $myx + $mywidth - 1, $myy + $myheight - 1, $myx + $mywidth - 1, $myy + $myheight - 1)
EndIf
If $myleftdown Then
_GDIPlus_PathAddArc($hPath, $myx, $myy + $myheight - $myround - 1, $myround, $myround, 90, 90)
Else
_GDIPlus_PathAddLine($hPath, $myx, $myy + $myheight - 1, $myx, $myy + $myheight - 1)
EndIf
_GDIPlus_PathCloseFigures($hPath)
Return $hPath
EndFunc ;==>_myPath