⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 candybutton.ctl

📁 支持监控包括传输控制协议和 UDP 的所有的互联网传输协议。同时程序具有实时文件防修改监控功能
💻 CTL
📖 第 1 页 / 共 5 页
字号:
VERSION 5.00
Begin VB.UserControl CandyButton 
   Appearance      =   0  'Flat
   AutoRedraw      =   -1  'True
   BackColor       =   &H00FFFFFF&
   ClientHeight    =   1335
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   1830
   BeginProperty Font 
      Name            =   "Tahoma"
      Size            =   9
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   ScaleHeight     =   89
   ScaleMode       =   3  'Pixel
   ScaleWidth      =   122
End
Attribute VB_Name = "CandyButton"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'****************************************************************************
'人人为我,我为人人
'枕善居汉化收藏整理
'发布日期:2007/09/20
'描    述:界面清爽VB版高级专业防火墙 Ver 2.0.3
'网    站:http://www.Mndsoft.com/  (VB6源码博客)
'网    站:http://www.VbDnet.com/   (VB.NET源码博客,主要基于.NET2005)
'e-mail  :Mndsoft@163.com
'e-mail  :Mndsoft@126.com
'OICQ    :88382850
'          如果您有新的好的代码别忘记给枕善居哦!
'****************************************************************************


Option Explicit
'-Selfsub declarations----------------------------------------------------------------------------
Private Enum eMsgWhen                                                       'When to callback
    MSG_BEFORE = 1
                                                            'Callback before the original WndProc
    MSG_AFTER = 2
                                                             'Callback after the original WndProc
    MSG_BEFORE_AFTER = MSG_BEFORE Or MSG_AFTER
                                'Callback before and after the original WndProc
End Enum
#If False Then 'Trick preserves Case of Enums when typing in IDE
Private MSG_BEFORE, MSG_AFTER, MSG_BEFORE_AFTER
#End If
Private Const ALL_MESSAGES               As Long = -1     'All messages callback
Private Const MSG_ENTRIES                As Long = 32     'Number of msg table entries
Private Const WNDPROC_OFF                As Long = &H38
 'Thunk offset to the WndProc execution address
Private Const GWL_WNDPROC                As Long = -4     'SetWindowsLong WndProc index
Private Const IDX_SHUTDOWN               As Long = 1      'Thunk data index of the shutdown flag
Private Const IDX_HWND                   As Long = 2      'Thunk data index of the subclassed hWnd
Private Const IDX_WNDPROC                As Long = 9      'Thunk data index of the original WndProc
Private Const IDX_BTABLE                 As Long = 11     'Thunk data index of the Before table
Private Const IDX_ATABLE                 As Long = 12     'Thunk data index of the After table
Private Const IDX_PARM_USER              As Long = 13
     'Thunk data index of the User-defined callback parameter data index
Private z_ScMem                          As Long          'Thunk base address
Private z_Sc(64)                         As Long          'Thunk machine-code initialised here
Private z_Funk                           As Collection    'hWnd/thunk-address collection
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Public Event Status(ByVal sStatus As String)
Private Const WM_MOUSEMOVE               As Long = &H200
Private Const WM_MOUSELEAVE              As Long = &H2A3
Private Const WM_MOVING                  As Long = &H216
Private Const WM_SIZING                  As Long = &H214
Private Const WM_EXITSIZEMOVE            As Long = &H232
Private Enum TRACKMOUSEEVENT_FLAGS
    TME_HOVER = &H1&
    TME_LEAVE = &H2&
    TME_QUERY = &H40000000
    TME_CANCEL = &H80000000
End Enum
#If False Then 'Trick preserves Case of Enums when typing in IDE
Private TME_HOVER, TME_LEAVE, TME_QUERY, TME_CANCEL
#End If
Private Type TRACKMOUSEEVENT_STRUCT
    cbSize                                   As Long
    dwFlags                                  As TRACKMOUSEEVENT_FLAGS
    hwndTrack                                As Long
    dwHoverTime                              As Long
End Type
Private bTrack                           As Boolean
Private bTrackUser32                     As Boolean
Private IsHover                          As Boolean
Private bMoving                          As Boolean
Public Event Click()
Attribute Click.VB_MemberFlags = "200"
Public Event DblClick()
Public Event MouseEnter()
Public Event MouseLeave()
Public Event MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Public Event MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Public Event MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
'-Candy Button declarations----------------------------------------------------------------------------
Public Enum eAlignment
    PIC_TOP
    PIC_BOTTOM
    PIC_LEFT
    PIC_RIGHT
End Enum
#If False Then 'Trick preserves Case of Enums when typing in IDE
Private PIC_TOP, PIC_BOTTOM, PIC_LEFT, PIC_RIGHT
#End If
Public Enum eStyle
    XP_Button
    XP_ToolBarButton
    Crystal
    Mac
    Mac_Variation
    WMP
    Plastic
    Iceblock
End Enum
#If False Then 'Trick preserves Case of Enums when typing in IDE
Private XP_Button, XP_ToolBarButton, Crystal, Mac, Mac_Variation, WMP, Plastic, Iceblock
#End If
Public Enum eColorScheme
    Custom
    Aqua
    WMP10
    DeepBlue
    DeepRed
    DeepGreen
    DeepYellow
End Enum
#If False Then 'Trick preserves Case of Enums when typing in IDE
Private Custom, Aqua, WMP10, DeepBlue, DeepRed, DeepGreen, DeepYellow
#End If
Public Enum eState
    eNormal
    ePressed
    eFocus
    eHover
    eChecked
End Enum
#If False Then 'Trick preserves Case of Enums when typing in IDE
Private eNormal, ePressed, eFocus, eHover, eChecked
#End If
Private Type tCrystalParam
    Ref_MixColorFrom                         As Long
    Ref_Intensity                            As Long
    Ref_Left                                 As Long
    Ref_Top                                  As Long
    Ref_Radius                               As Long
    Ref_Height                               As Long
    Ref_Width                                As Long
    RadialGXPercent                          As Long
    RadialGYPercent                          As Long
    RadialGOffsetX                           As Long
    RadialGOffsetY                           As Long
    RadialGIntensity                         As Long
End Type
Private Type BITMAPINFOHEADER    '40 bytes
    biSize                                   As Long
    biWidth                                  As Long
    biHeight                                 As Long
    biPlanes                                 As Integer
    biBitCount                               As Integer
    biCompression                            As Long
    biSizeImage                              As Long
    biXPelsPerMeter                          As Long
    biYPelsPerMeter                          As Long
    biClrUsed                                As Long
    biClrImportant                           As Long
End Type
Private Type RGBQUAD
    rgbBlue                                  As Byte
    rgbGreen                                 As Byte
    rgbRed                                   As Byte
    rgbReserved                              As Byte
End Type
Private Type BITMAP    '24 bytes
    bmType                                   As Long
    bmWidth                                  As Long
    bmHeight                                 As Long
    bmWidthBytes                             As Long
    bmPlanes                                 As Integer
    bmBitsPixel                              As Integer
    bmBits                                   As Long
End Type
Private Type BITMAPINFO
    bmiHeader                                As BITMAPINFOHEADER
    bmiColors                                As RGBQUAD
End Type
Private Const BI_RGB                     As Long = 0
Private Const DIB_RGB_COLORS             As Long = 0
Private m_PictureAlignment               As eAlignment
Private m_Style                          As eStyle
Private m_Checked                        As Boolean
Private m_hasFocus                       As Boolean
Private m_Caption                        As String
Private m_StdPicture                     As StdPicture
Private m_Font                           As StdFont
Private m_ColorButtonHover               As OLE_COLOR
Private m_ColorButtonUp                  As OLE_COLOR
Private m_ColorButtonDown                As OLE_COLOR
Private m_ColorBright                    As OLE_COLOR
Private m_ForeColor                      As OLE_COLOR
Private m_DisplayHand                    As Boolean
Private CornerRadius                     As Long
Private m_BorderBrightness               As Long
Private m_ColorScheme                    As eColorScheme
Private m_bHighLited                     As Boolean
Private m_bIconHighLite                  As Boolean
Private m_lIconHighLiteColor             As OLE_COLOR
Private m_bCaptionHighLite               As Boolean
Private m_lCaptionHighLiteColor          As OLE_COLOR
Private m_bEnabled                       As Boolean
Private m_InitCompleted                  As Boolean
Private hButtonRegion                    As Long
Private Const m_def_ForeColor            As Long = vbBlack
Private Const m_def_PictureAlignment     As Byte = 0
Private Const DST_TEXT                   As Long = &H1
Private Const DST_PREFIXTEXT             As Long = &H2
Private Const DST_COMPLEX                As Long = &H0
Private Const DST_ICON                   As Long = &H3
Private Const DST_BITMAP                 As Long = &H4
Private Const DSS_NORMAL                 As Long = &H0
Private Const DSS_UNION                  As Long = &H10
Private Const DSS_DISABLED               As Long = &H20
Private Const DSS_MONO                   As Long = &H80
Private Const DSS_RIGHT                  As Long = &H8000
Private Const RGN_XOR                    As Integer = 3
Private Const MK_LBUTTON                 As Long = &H1
Private Type POINTAPI
    X                                        As Long
    Y                                        As Long
End Type
Private Type RECT
    Left                                     As Long
    Top                                      As Long
    Right                                    As Long
    Bottom                                   As Long
End Type
Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, _
                                                    ByVal hRgn As Long, _
                                                    ByVal bRedraw As Boolean) As Long
Private Declare Function CombineRgn Lib "gdi32" (ByVal hDestRgn As Long, _
                                                 ByVal hSrcRgn1 As Long, _
                                                 ByVal hSrcRgn2 As Long, _
                                                 ByVal nCombineMode As Long) As Long
Private Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As Long, _
                                                    ByVal Y1 As Long, _
                                                    ByVal X2 As Long, _
                                                    ByVal Y2 As Long) As Long
Private Declare Function CreateRoundRectRgn Lib "gdi32" (ByVal X1 As Long, _
                                                         ByVal Y1 As Long, _
                                                         ByVal X2 As Long, _
                                                         ByVal Y2 As Long, _
                                                         ByVal X3 As Long, _
                                                         ByVal Y3 As Long) As Long
Private Declare Function DrawState Lib "user32" Alias "DrawStateA" (ByVal hdc As Long, _
                                                                    ByVal hBrush As Long, _
                                                                    ByVal lpDrawStateProc As Long, _
                                                                    ByVal lParam As Long, _
                                                                    ByVal wParam As Long, _
                                                                    ByVal X As Long, _
                                                                    ByVal Y As Long, _
                                                                    ByVal cX As Long, _
                                                                    ByVal cY As Long, _
                                                                    ByVal fuFlags As Long) As Long
Private Declare Function DrawStateText Lib "user32" Alias "DrawStateA" (ByVal hdc As Long, _
                                                                        ByVal hBrush As Long, _
                                                                        ByVal lpDrawStateProc As Long, _
                                                                        ByVal lParam As String, _
                                                                        ByVal wParam As Long, _
                                                                        ByVal n1 As Long, _
                                                                        ByVal n2 As Long, _
                                                                        ByVal n3 As Long, _
                                                                        ByVal n4 As Long, _
                                                                        ByVal un As Long) As Long
Private Declare Function CreateSolidBrush Lib "gdi32" (ByVal crColor As Long) As Long
Private Declare Function SetPixelV Lib "gdi32" (ByVal hdc As Long, _
                                                ByVal X As Long, _
                                                ByVal Y As Long, _
                                                ByVal crColor As Long) As Long
Private Declare Function TranslateColor Lib "olepro32.dll" Alias "OleTranslateColor" (ByVal clr As OLE_COLOR, _
                                                                                      ByVal palet As Long, _
                                                                                      Col As Long) As Long
Private Declare Function PtInRegion Lib "gdi32" (ByVal hRgn As Long, _
                                                 ByVal X As Long, _
                                                 ByVal Y As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Function InflateRect Lib "user32" (lpRect As RECT, _
                                                   ByVal X As Long, _
                                                   ByVal Y As Long) As Long
Private Declare Function Ellipse Lib "gdi32" (ByVal hdc As Long, _
                                              ByVal X1 As Long, _
                                              ByVal Y1 As Long, _
                                              ByVal X2 As Long, _

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -