回复 4# eaglelin
源自:http://www.autoitx.com/forum.php ... hlight=%CE%DE%B1%DF
#NoTrayIcon
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#PRE_icon=D:\windows\system32\SHELL32.dll|-193
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <GuiListView.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include<ie.au3>
#include <INet.au3>
#include <array.au3>
Dim $guiW = @DesktopWidth-600,$guiH = @DesktopHeight-300,$Bk_C=12
Dim $GUI_BS[15] = [0x808000, 0x008080, 0xFF0000, 0x0000FF, 0x800000, 0x000080, 0x808080, 0x00FF00, 0xFF00FF, 0xFFFFFF, 0x008000, 0x800080, 0xC0C0C0, 0xFFFF00, 0x00FFFF]
Dim $title = "//⊙简单的界面 by:绿色风⊙//"
opt("GUICloseOnESC",0)
$Form1 = GUICreate($title, $guiW, $guiH, -1, -1,BitOR($WS_POPUP, $WS_CLIPSIBLINGS))
GUISetBkColor($GUI_BS[$Bk_C])
#Region 模版 GUI顶部与低部
GUICtrlCreateLabel($title,10,4)
GUICtrlCreateGroup("", $guiW - 36 - 36-3 , -5, 16, 22)
GUICtrlSetResizing(-1, 544 + 260)
$labw = GUICtrlCreateLabel("?", $guiW - 13-18 - 36-3 , 4, 8, 10) ;帮助
GUICtrlSetResizing(-1, 544 + 260)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlCreateGroup("", $guiW - 18 - 36-3, -5, 16, 22)
GUICtrlSetResizing(-1, 544 + 260)
$labS = GUICtrlCreateLabel("#", $guiW - 13 - 36-3, 4, 8, 10) ;换背景色
GUICtrlSetResizing(-1, 544 + 260)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlCreateGroup("", $guiW - 18 -18-3 , -5, 16, 22)
GUICtrlSetResizing(-1, 544 + 260)
$labF = GUICtrlCreateLabel("-", $guiW - 13 - 18-3, 4, 8, 10) ;最小化
GUICtrlSetResizing(-1, 544 + 260)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlCreateGroup("", $guiW - 18-3, -5, 16, 22)
GUICtrlSetResizing(-1, 544 + 260)
$labe = GUICtrlCreateLabel("x", $guiW - 13-3, 3, 8, 10) ;关闭
GUICtrlSetResizing(-1, 544 + 260)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlCreateLabel("",0,18,$guiW+4,2,$SS_ETCHEDHORZ) ;顶画一条线
GUICtrlSetResizing(-1, 544 )
GUICtrlCreateLabel("",0,$guiH-18,$guiW+4,2,$SS_ETCHEDHORZ) ;底部 画一条线
GUICtrlSetResizing(-1, 576)
GUICtrlCreateLabel("⊙",2,$guiH-14,14,14)
GUICtrlSetResizing(-1, 768+66)
$sow = GUICtrlCreateLabel("qq:79664738",16,$guiH-14,100,14) ;底部信息显示
GUICtrlSetResizing(-1, 768+66)
GUICtrlCreateLabel("⊙",120,$guiH-14,14,14)
GUICtrlSetResizing(-1, 768+66)
GUICtrlCreateLabel("http://tl158.taobao.com",136,$guiH-14,300,14) ;底部信息显示
GUICtrlSetResizing(-1, 768+66)
#EndRegion
Opt("GUIOnEventMode", 1)
GUISetState(@SW_SHOW)
GUIRegisterMsg($WM_NCHITTEST, "_GuiMove") ;窗体移动
GUICtrlSetOnEvent($labe, "gui") ;退出
GUICtrlSetOnEvent($labF, "gui") ;最小化
GUICtrlSetOnEvent($labS, "gui") ;换背景色
GUICtrlSetOnEvent($labw, "gui") ;help
GUISetOnEvent($GUI_EVENT_CLOSE, "gui")
_RoundGUI($Form1, 0, 0, 20, 10) ;窗体圆角
While 1
Sleep(1000)
WEnd
#Region ;模版 不动的
Func gui() ;窗体控件事件
Switch @GUI_CtrlId
Case $labe,$GUI_EVENT_CLOSE;退出
Exit
Case $labS ;换背景我
$Bk_C += 1
If $Bk_C = 15 Then Dim $Bk_C = 0
GUISetBkColor($GUI_BS[$Bk_C], $Form1) ;设置窗体的背景颜色
Case $labF ;最小化
WinSetState($Form1, "", @SW_MINIMIZE)
Case $labw ;help
MsgBox(0,"传说 中 的帮 助","还没想好写什么,"&@CRLF &"如果你觉得这个对你学习au3有参考价值:嘿!嘿!"&@crlf&"那就随机赠送几张彩票(taobaoID:VBT风哥)或者"&@crlf&"捐赠点米米(支付宝ID:13640701096)给我更好啦!!!"&@CRLF&"不过呢,没看到也没关系,反正风哥的东西都是开放的!"&@crlf&"只是最近的我来的比较少了,因为俺失业中...",15)
EndSwitch
EndFunc ;==>gui
Func _GuiMove($hWnd, $iMsg, $iwParam, $ilParam) ;窗体 缩放拉伸
Dim $winXY = 1 ; 窗口被拉伸 ,检测窗体最小尺寸 开关
$MousePos = MouseGetPos()
$nPos = WinGetPos("")
$DT = ($hWnd = $Form1 And $iMsg = $WM_NCHITTEST)
$DDx = ($MousePos[0] < $nPos[0] + $nPos[2] - 8) And ($MousePos[0] > $nPos[0] + 8)
$DDy = ($MousePos[1] < $nPos[1] + $nPos[3] - 8) And ($MousePos[1] > $nPos[1] + 8)
; 以上是无边框窗体移动事件的发生条件
If $DT And $DDx And $DDy Then Return $HTCAPTION ;移动
EndFunc ;==>_GuiMove
Func _RoundGUI($h_win, $i_x1, $i_y1, $i_x3, $i_y3) ;窗体圆角API
Dim $pos, $ret, $ret2
$pos = WinGetPos($h_win)
$ret = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long", $i_x1, "long", $i_y1, "long", $pos[2], "long", $pos[3], "long", $i_x3, "long", $i_y3)
If $ret[0] Then
$ret2 = DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $ret[0], "int", 1)
If $ret2[0] Then
Return 1
Else
Return 0
EndIf
Else
Return 0
EndIf
EndFunc ;==>_RoundGUI
#EndRegion
|