forgetbaidu
发表于 2011-11-18 22:24:32
太有才了
xlj310
发表于 2011-11-18 22:46:08
很犀利 借鉴一下
思夜月心
发表于 2011-11-18 23:33:53
我是来看如何高仿B60的!
haijie1223
发表于 2011-11-19 00:21:24
不错的。。。
xz00311
发表于 2011-11-19 09:29:13
看看是什么好东东先
xz00311
发表于 2011-11-19 09:34:43
这东西好啊支持一下
cmirt
发表于 2011-11-19 13:06:25
不错啊!!!漂亮!
jkq920
发表于 2011-11-19 14:36:04
来学习一下.
shenrenba
发表于 2011-11-19 15:17:45
回复 1# seniors
TIP不能用鼠标效果有问题删除了(方法是先创建PIC 检测到信息就把PIC控件移动到悬停控件下 问题是换控件后源地方会出现空白 不显示任何东西) 等下就开会了 先这样 等下次来了 在看#include <winapiex.au3>
#include <Constants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <GDIPlusEx.au3>
#include <array.au3>
#include <Thread.au3>
Opt("TrayMenuMode", 1)
Opt("TrayOnEventMode", 1)
Opt('GUIOnEventMode', 1)
_RTEmptyWorkingSet();减少内存占用
;窗口宽度,高度,圆角
Global $zhuwidth = 600, $zhuheight = 400, $winround = 10
;配色颜色数组,当前皮肤序号
Global $pifucolor = , $pifu = 0
;皮肤图片文件数组,第一个为“”空,是一个标志,为空则按本色显示,当前皮肤序号
Global $imgpifu = ["", @ScriptDir & "\top\1.jpg", @ScriptDir & "\top\2.jpg", @ScriptDir & "\top\3.jpg", @ScriptDir & "\top\4.jpg", @ScriptDir & "\top\5.jpg"], $imgNum = 1
;大图标区域数组,当前选中序号,当前hover序号,当前hover标识,当hover标识和hover序号相同时不重绘
Global $PanBtnRect, $SelectPanBtn = 1, $OnPanBtnNum = 0, $OnPanBtnFlag = 0
;系统按钮区域数组,系统按钮tip数组,hoevr按钮标识,hover按钮序号,标识序号相同不重绘,Down按钮序号
Global $topbutton, $topbuttontip, $onTopbuttonFlag = 0, $onTopbuttonNum = 0, $DownTopbuttonNum = 1
;背景图片,lable,背景是否图片,最小化和显示状态
Global $skin_pic,$zhu_label, $work,$stat
;GUI,PIC,PIC调用的图片数组
Global $zhu_gui, $topbutton_pic, $topbuttonimage
_GDIPlus_Startup()
_initRect();按钮区域等初始设置
;窗体建立
_gui_create()
;注册窗口消息函数
GUIRegisterMsg($WM_NCHITTEST, 'WM_NCHITTEST')
;托盘退出
Global $exit = TrayCreateItem("退出")
TrayItemSetOnEvent(-1, "exitfunc")
While 1
Sleep(100)
;最小化在显示窗体有问题暂时先这样
If $stat=1And WinGetState($zhu_gui)=15 Then
GUIDelete($zhu_gui)
_gui_create()
$stat=0
EndIf
WEnd
Func _gui_create()
$zhu_gui = GUICreate("360界面预览", $zhuwidth, $zhuheight, -1, -1, $WS_POPUP, $WS_EX_LAYERED)
$skin_pic = GUICtrlCreatePic("", 0, 0, $zhuwidth, $zhuheight)
GUICtrlSetState(-1, $Gui_Disable)
$zhu_label=GUICtrlCreateLabel("第"&$DownTopbuttonNum&"页", 20, 120, $zhuwidth - 40, 30)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont(-1, 24)
GUICtrlSetColor(-1, 0x0860a8)
For $i = 0 To UBound($topbutton) - 1
$topbutton_pic[$i] = GUICtrlCreatePic("", DllStructGetData($topbutton[$i], 1), DllStructGetData($topbutton[$i], 2), DllStructGetData($topbutton[$i], 3), DllStructGetData($topbutton[$i], 4))
GUICtrlSetState(-1, $Gui_Disable)
If $i > 6 Then
_setimage(-1, $topbuttonimage[$i], 60, 60, DllStructGetData($topbutton[$i], 1), DllStructGetData($topbutton[$i], 2))
Else
_setimage(-1, $topbuttonimage[$i])
EndIf
Next
GUISetState()
;背景是否图片
If $work = 1 Then
Global $hGraph = _GDIPlus_GraphicsCreateFromHWND($zhu_gui)
_GDIPlus_GraphicsFillRect($hGraph, 0, 0, $zhuwidth, $zhuheight, _GDIPlus_BrushCreateSolid($pifucolor[$pifu]))
_GDIPlus_GraphicsDispose($hGraph)
Else
_setimage($skin_pic, $imgpifu[$imgNum], $zhuwidth, $zhuheight, 0, 0)
EndIf
EndFunc ;==>_gui_create
Func _setimage($handle, $image, $w_picctrl = -1, $h_picctrl = -1, $ix = -1, $iy = -1);好像是AFAN写的 修改了一点
$himage = _GDIPlus_ImageLoadFromFile($image)
If $w_picctrl <> -1 Then
$w_img = _GDIPlus_ImageGetWidth($himage)
$h_img = _GDIPlus_ImageGetHeight($himage)
Local $kgb = $h_picctrl / $w_picctrl
Local $kgb1 = $h_img / $w_img
Local $x_py = 0, $y_py = 0, $hBMP, $hObject
If $w_img > $w_picctrl Or $h_img > $h_picctrl Then
If $kgb1 > $kgb Then
$h_img = $h_picctrl
$w_img = Round(1 / $kgb1 * $h_img)
$x_py = ($w_picctrl - $w_img) / 2
Else
$w_img = $w_picctrl
$h_img = Round($kgb1 * $w_img)
$y_py = ($h_picctrl - $h_img) / 2
EndIf
Else
$x_py = ($w_picctrl - $w_img) / 2
$y_py = ($h_picctrl - $h_img) / 2
EndIf
EndIf
$hBMP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($himage)
GUICtrlSendMsg($handle, 0x0172, 0, $hBMP)
_WinAPI_DeleteObject($himage)
_WinAPI_DeleteObject($hBMP)
If $w_picctrl <> -1 Then
_WinAPI_DeleteObject($hObject)
If $ix = 0 And $iy = 0 Then
GUICtrlSetPos($handle, $ix, $iy, $w_img, $h_img)
Else
GUICtrlSetPos($handle, $ix + $x_py - 1, $iy + $y_py - 1, $w_img, $h_img)
GUICtrlSetPos($handle, $ix + $x_py, $iy + $y_py)
EndIf
EndIf
EndFunc ;==>_setimage
Func WM_NCHITTEST($hWnd, $Msg, $wParam, $lParam)
Local $tPoint
$tPoint = GUIGetCursorInfo($hWnd);鼠标信息
;ConsoleWrite(_ArrayToString($tPoint)&@CRLF)想看信息就使用这句
If $tPoint = 1 Then;左键按下
Switch $tPoint
Case 5;退出
exitfunc()
Case 6, 8;最大化,设置
MsgBox(0, "", " 测试 ", 2, $zhu_gui)
Case 7;最小化
GUISetState(@SW_MINIMIZE, $zhu_gui)
ToolTip("")
$stat=1
Case 9;反馈
ShellExecute("http://www.autoitx.com/thread-28704-1-1.html")
Case 10;换背景图片
_huanimg()
Case 11;换背景色
_huanfu()
Case 12 To 17;6个大图片控件
$DownTopbuttonNum=$tPoint-11
GUICtrlSetData($zhu_label,"第"&$DownTopbuttonNum&"页")
EndSwitch
EndIf
Return 2
EndFunc ;==>WM_NCHITTEST
Func exitfunc()
_GDIPlus_Shutdown()
Exit
EndFunc ;==>exitfunc
Func _initRect();初始化系统按钮图标位置,中间大按钮位置等
For $ii = 1 To 6;初始化6个大按钮位置
$PanBtnRect[$ii - 1] = DllStructCreate($tagRECT)
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
;初始化右上角系统按钮位置,及系统按钮hover,Down图像及提示信息
$topbuttonimage = @ScriptDir & "\top\TopPanelBtnClose.png"
Local $kzImage = _GDIPlus_ImageLoadFromFile($topbuttonimage)
$mybtnx = $zhuwidth - 2 - _GDIPlus_ImageGetWidth($kzImage)
$topbutton = DllStructCreate($tagRECT)
DllStructSetData($topbutton, 1, $mybtnx)
DllStructSetData($topbutton, 2, 1)
DllStructSetData($topbutton, 3, $mybtnx + _GDIPlus_ImageGetWidth($kzImage))
DllStructSetData($topbutton, 4, _GDIPlus_ImageGetHeight($kzImage) + 1)
$topbuttontip = "关闭"
$topbuttonimage = @ScriptDir & "\top\TopPanelBtnMax.png"
$kzImage = _GDIPlus_ImageLoadFromFile($topbuttonimage)
$mybtnx -= _GDIPlus_ImageGetWidth($kzImage)
$topbutton = DllStructCreate($tagRECT)
DllStructSetData($topbutton, 1, $mybtnx + 1)
DllStructSetData($topbutton, 2, 1)
DllStructSetData($topbutton, 3, $mybtnx + _GDIPlus_ImageGetWidth($kzImage))
DllStructSetData($topbutton, 4, _GDIPlus_ImageGetHeight($kzImage) + 1)
$topbuttontip = "最大化"
$topbuttonimage = @ScriptDir & "\top\TopPanelBtnMin.png"
$kzImage = _GDIPlus_ImageLoadFromFile($topbuttonimage)
$mybtnx -= _GDIPlus_ImageGetWidth($kzImage)
$topbutton = DllStructCreate($tagRECT)
DllStructSetData($topbutton, 1, $mybtnx + 1)
DllStructSetData($topbutton, 2, 1)
DllStructSetData($topbutton, 3, $mybtnx + _GDIPlus_ImageGetWidth($kzImage))
DllStructSetData($topbutton, 4, _GDIPlus_ImageGetHeight($kzImage) + 1)
$topbuttontip = "最小化"
$topbuttonimage = @ScriptDir & "\top\TopPanelBtnSetting.png"
$kzImage = _GDIPlus_ImageLoadFromFile($topbuttonimage)
$mybtnx -= _GDIPlus_ImageGetWidth($kzImage)
$topbutton = DllStructCreate($tagRECT)
DllStructSetData($topbutton, 1, $mybtnx + 1)
DllStructSetData($topbutton, 2, 1)
DllStructSetData($topbutton, 3, $mybtnx + _GDIPlus_ImageGetWidth($kzImage))
DllStructSetData($topbutton, 4, _GDIPlus_ImageGetHeight($kzImage) + 1)
$topbuttontip = "设置"
$topbuttonimage = @ScriptDir & "\top\TopPanelBtnFeedback.png"
$kzImage = _GDIPlus_ImageLoadFromFile($topbuttonimage)
$mybtnx -= _GDIPlus_ImageGetWidth($kzImage)
$topbutton = DllStructCreate($tagRECT)
DllStructSetData($topbutton, 1, $mybtnx)
DllStructSetData($topbutton, 2, 1)
DllStructSetData($topbutton, 3, $mybtnx + _GDIPlus_ImageGetWidth($kzImage))
DllStructSetData($topbutton, 4, _GDIPlus_ImageGetHeight($kzImage) + 1)
$topbuttontip = "反馈"
$topbuttonimage = @ScriptDir & "\top\skin.png"
$kzImage = _GDIPlus_ImageLoadFromFile($topbuttonimage)
$mybtnx -= _GDIPlus_ImageGetWidth($kzImage)
$topbutton = DllStructCreate($tagRECT)
DllStructSetData($topbutton, 1, $mybtnx)
DllStructSetData($topbutton, 2, 1)
DllStructSetData($topbutton, 3, $mybtnx + _GDIPlus_ImageGetWidth($kzImage))
DllStructSetData($topbutton, 4, _GDIPlus_ImageGetHeight($kzImage) + 1)
$topbuttontip = "皮肤"
$topbuttonimage = @ScriptDir & "\top\TopPanelBtnSkin.png"
$kzImage = _GDIPlus_ImageLoadFromFile($topbuttonimage)
$mybtnx = $zhuwidth - 20 - _GDIPlus_ImageGetWidth($kzImage)
$topbutton = DllStructCreate($tagRECT)
DllStructSetData($topbutton, 1, $mybtnx)
DllStructSetData($topbutton, 2, 30)
DllStructSetData($topbutton, 3, $mybtnx + _GDIPlus_ImageGetWidth($kzImage))
DllStructSetData($topbutton, 4, _GDIPlus_ImageGetHeight($kzImage) + 30)
$topbuttontip = "配色"
For $ii = 1 To 6
$topbuttonimage[$ii + 6] = @ScriptDir & "\app\" & $ii & ".png"
$kzImage = _GDIPlus_ImageLoadFromFile($topbuttonimage[$ii + 6])
$topbutton[$ii + 6] = DllStructCreate($tagRECT)
DllStructSetData($topbutton[$ii + 6], 1, DllStructGetData($PanBtnRect[$ii - 1], 1))
DllStructSetData($topbutton[$ii + 6], 2, DllStructGetData($PanBtnRect[$ii - 1], 2))
DllStructSetData($topbutton[$ii + 6], 3, 60)
DllStructSetData($topbutton[$ii + 6], 4, 60)
$topbuttontip[$ii + 6] = "第"&$ii&"页"
Next
_WinAPI_DeleteObject($kzImage)
EndFunc ;==>_initRect
Func _huanfu();换配色,不想用弹出窗口选择颜色了,简单点,按一次本色本色按钮颜色选择+1
$pifu += 1;颜色变量序号加1
If $pifu == UBound($pifucolor) Then $pifu = 0;如果颜色序号走出预设颜色数,归0
;显示更换颜色后的窗口
;~ _myback($zhuwidth,$zhuheight,$pifucolor[$pifu])
GUIDelete($zhu_gui)
$work = 1
_gui_create()
$work = 0
EndFunc ;==>_huanfu
Func _huanimg();换背景图片
$imgNum += 1
If $imgNum == UBound($imgpifu) Then $imgNum = 1;如背景图片序号超出预设背景数,归1,因为0 为无背景图片
_setimage($skin_pic, $imgpifu[$imgNum], $zhuwidth, $zhuheight, 0, 0)
EndFunc ;==>_huanimg
seniors
发表于 2011-11-19 16:03:05
回复 114# shenrenba
嗯,用PIC控件不错
不过这个_setimage,好像比较闪,下次我用bitblt试试
另外,看不出为什么最小化后,再显示又会回到原来的背景
DenQ
发表于 2011-11-19 16:05:50
支持一个。
touch_xu
发表于 2011-11-19 16:37:31
楼主太帅了
xlcwxl
发表于 2011-11-19 17:15:04
不错的界面
srhack
发表于 2011-11-19 19:14:48
好东西值得支持
srhack
发表于 2011-11-19 19:14:52
好东西值得支持