找回密码
 加入
搜索
查看: 3097|回复: 0

[原创] 请高手在此源码加一个图片按钮

[复制链接]
发表于 2013-3-16 12:27:16 | 显示全部楼层 |阅读模式
本帖最后由 影子 于 2013-3-16 12:40 编辑

请高手在此源码加一个图片按钮,要求点击该【最好是自绘按钮】按钮后则在下面框中显示指定网页,谢谢啦。
#NoTrayIcon
#region ;**** 参数创建于 ACNWrapper_GUI ****
#PRE_Icon=xuan.ico
#PRE_Outfile=影子.exe
#PRE_Res_Comment=影子
#PRE_Res_Description=炫,
#PRE_Res_Fileversion=20
#PRE_Res_LegalCopyright=影子
#PRE_Res_requestedExecutionLevel=None
#PRE_Run_Tidy=y
#endregion ;**** 参数创建于 ACNWrapper_GUI ****
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#include <IE.au3>

$Form1 = GUICreate("炫", 320, 175, "", "", BitOR($WS_POPUP, $WS_CLIPSIBLINGS))
GUISetBkColor(0X1A1A1A)
GUICtrlSetBkColor(-1, 0); bgrey
GUICtrlSetColor(-1, 0X1A1A1A)
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $Form1, "int", _
                1000, "long", 0x00000010);主窗口打开效果;参数 1000 为调整渐大渐小(扩大/缩小)的效果速度
$state = 1 ;运行状态
If $state = 1 Or $state = "" Then
        GUISetState(@SW_SHOW)
ElseIf $state = 0 Then
        GUISetState(@SW_HIDE)
EndIf

Global $hCallback = DllCallbackRegister("My_btnProc", "int", "hWnd;uint;wparam;lparam")
Global $tCallback = DllCallbackGetPtr($hCallback)
GUISetBkColor(0X1A1A1A)
$1 = ObjCreate("Shell.Explorer.2")
$2 = GUICtrlCreateObj($1, -1, 30, 320, 100)
GUICtrlSetResizing(-1, 1)
$B11 = GUICtrlCreateButton("X", 270, 0, 30, 30)
GUICtrlSetBkColor(-1, 0X1A1A1A); blue
GUICtrlSetColor(-1, 0XFFFFFF)
$Button13 = GUICtrlCreateButton("—", 240, 0, 30, 30)
GUICtrlSetBkColor(-1, 0X1A1A1A); blue
GUICtrlSetColor(-1, 0XFFFFFF)
$Button14 = GUICtrlCreateButton("原", 2000, 0, 30, 30)
GUICtrlSetBkColor(-1, 0X1A1A1A); blue
GUICtrlSetColor(-1, 0XFFFFFF)
$1.navigate("http://baidu.com/")
GUISetState(@SW_SHOW)
GUIRegisterMsg($WM_NCHITTEST, "topbottom")
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $B11
                        Exit
                       
                       
                       
                Case $Button13
                        WinSetState($Form1, "", @SW_MINIMIZE)
                Case $Button14
                        WinSetState($Form1, "", @SW_RESTORE)
                        Exit
                       
        EndSwitch
WEnd
Func topbottom($hWnd, $iMsg, $iwParam, $ilParam)
        $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)
        ; 以上是无边框窗体移动事件的发生条件

        $S1x = ($MousePos[0] >= $nPos[0] + $nPos[2] - 8) ; 右下角x
        $S1y = ($MousePos[1] >= $nPos[1] + $nPos[3] - 8) ; 右下角y
        $S2x = ($MousePos[0] <= $nPos[0] + 8) ; 左上角x
        $S2y = ($MousePos[1] <= $nPos[1] + 8) ; 左上角y
        $S3x = ($MousePos[0] <= $nPos[0] + 8) ; 左下角x
        $S3y = ($MousePos[1] >= $nPos[1] + $nPos[3] - 8) ; 左下角y
        $S4x = ($MousePos[0] >= $nPos[0] + $nPos[2] - 8) ; 右上角x
        $S4y = ($MousePos[1] <= $nPos[1] + 8) ; 右上角y
        ;以上是四角拉伸事件的发生条件

        $S5 = ($MousePos[0] <= $nPos[0] + 8) ; 左边
        $S6 = ($MousePos[1] <= $nPos[1] + 8) ; 顶边
        $S7 = ($MousePos[0] >= $nPos[0] + $nPos[2] - 8) ; 右边
        $S8 = ($MousePos[1] >= $nPos[1] + $nPos[3] - 8) ; 底边
        ;以上是四边拉伸事件的发生条件

        If $DT And $DDx And $DDy Then Return $HTCAPTION ;移动
        If $S1x And $S1y Then Return $HTBOTTOMRIGHT ;右下角拉伸
        If $S2x And $S2y Then Return $HTTOPLEFT ;左上角拉伸
        If $S3x And $S3y Then Return $HTBOTTOMLEFT ;左下角拉伸
        If $S4x And $S4y Then Return $HTTOPRIGHT ;右上角拉伸
        If $S5 Then Return $HTLEFT ;左边拉伸
        If $S6 Then Return $HTTOP ;上边拉伸
        If $S7 Then Return $HTRIGHT ;右边拉伸
        If $S8 Then Return $HTBOTTOM ;下边拉伸
EndFunc   ;==>topbottom
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-12-28 16:56 , Processed in 0.109389 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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