📄 isbutton.ctl
字号:
Private Type POINT
x As Long
Y As Long
End Type
Private Type SIZE
cX As Long
cY As Long
End Type
Private Type RECT
Left As Long
Top As Long
Right As Long
bottom As Long
End Type
Private Type RGB 'Required for color trnsform using RGB
Red As Byte
Green As Byte
Blue As Byte
End Type
Private Type tSubData 'Subclass data type
hwnd As Long 'Handle of the window being subclassed
nAddrSub As Long 'The address of our new WndProc (allocated memory).
nAddrOrig As Long 'The address of the pre-existing WndProc
nMsgCntA As Long 'Msg after table entry count
nMsgCntB As Long 'Msg before table entry count
aMsgTblA() As Long 'Msg after table array
aMsgTblB() As Long 'Msg Before table array
End Type
''Tooltip Window Types
Private Type TOOLINFO
lSize As Long
lFlags As Long
lHwnd As Long
lId As Long
lpRect As RECT
hInstance As Long
lpStr As String
lParam As Long
End Type
Private Type OSVERSIONINFOEX 'OS Version
dwOSVersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
szCSDVersion As String * 128
wServicePackMajor As Integer
wServicePackMinor As Integer
wSuiteMask As Integer
wProductType As Byte
wReserved As Byte
End Type
Enum isbStyle 'Styles
[isbNormal] = &H0
[isbSoft] = &H1
[isbFlat] = &H2
[isbJava] = &H3
[isbOfficeXP] = &H4
[isbWindowsXP] = &H5
[isbWindowsTheme] = &H6
[isbPlastik] = &H7
[isbGalaxy] = &H8
[isbKeramik] = &H9
[isbMacOSX] = &HA
End Enum
Enum isbButtonType
isbButton = &H0
isbCheckBox = &H1
End Enum
Enum isbAlign
[isbBottom] = &H0
[isbLeft] = &H1
[isbRight] = &H2
[isbTop] = &H3
[isbCenter] = &H4
End Enum
Private Enum isEstate
statenormal = &H1
stateHot = &H2
statePressed = &H3
statedisabled = &H4
stateDefaulted = &H5
End Enum
Private Type MSG 'Windows Message Structure
hwnd As Long
message As Long
wParam As Long
lParam As Long
time As Long
pt As POINT
End Type
Private Type tagTRACKMOUSEEVENT
cbSize As Long
dwFlags As Long
hwndTrack As Long
dwHoverTime As Long
End Type
Private Type TRIVERTEX 'For gradient Drawing
x As Long
Y As Long
Red As Integer
Green As Integer
Blue As Integer
Alpha As Integer
End Type
Private Type GRADIENT_RECT
UpperLeft As Long
LowerRight As Long
End Type
Private Type GRADIENT_TRIANGLE
Vertex1 As Long
Vertex2 As Long
Vertex3 As Long
End Type
Private Type DRAWTEXTPARAMS 'Required for DrawText
cbSize As Long
iTabLength As Long
iLeftMargin As Long
iRightMargin As Long
uiLengthDrawn As Long
End Type
Private Type BLENDFUNCTION 'Required for Alphablend API
BlendOp As Byte
BlendFlags As Byte
SourceConstantAlpha As Byte
AlphaFormat As Byte
End Type
Private Type RGBQUAD
rgbBlue As Byte
rgbGreen As Byte
rgbRed As Byte
rgbReserved As Byte
End Type
Private Type BITMAPINFOHEADER
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 BITMAPINFO
bmiHeader As BITMAPINFOHEADER
bmiColors As RGBQUAD
End Type
Private Type UxTheme 'Imported from a Cls File from VBAccelerator.com
sClass As String 'And edited to keep the control in a single file.
Part As Long 'I didn't used all the constant definitions where used
State As Long 'in the original file, cuz I don't need them all
hdc As Long 'But I added some others I need, like text offset
hwnd As Long 'properties and UseTheme, to Detect If the draw was
Left As Long 'succesfull or not, and then use classic windows Style
Top As Long 'Drawing.
Width As Long 'All the credits about the usage of UxTheme.dll defined on
Height As Long 'cUxTheme.cls go for Steve at www.vbaccelerator.com
Text As String
TextAlign As DrawTextFlags
IconIndex As Long
hIml As Long
RaiseError As Boolean
UseThemeSize As Boolean
UseTheme As Boolean
TextOffset As Long
RightTextOffset As Long
End Type
'*************************************************************
'
' Required Enums
'
'*************************************************************
Private Enum DrawTextAdditionalFlags
DTT_GRAYED = &H1 '// draw a grayed-out string
End Enum
Private Enum THEMESIZE
TS_MIN '// minimum size
TS_TRUE '// size without stretching
TS_DRAW '// size that theme mgr will use to draw part
End Enum
Private Enum eMsgWhen
MSG_AFTER = 1 'Message calls back after the original (previous) WndProc
MSG_BEFORE = 2 'Message calls back before the original (previous) WndProc
MSG_BEFORE_AND_AFTER = MSG_AFTER Or MSG_BEFORE 'Message calls back before and after the original (previous) WndProc
End Enum
Private Enum TRACKMOUSEEVENT_FLAGS
TME_HOVER = &H1&
TME_LEAVE = &H2&
TME_QUERY = &H40000000
TME_CANCEL = &H80000000
End Enum
Private Type TRACKMOUSEEVENT_STRUCT
cbSize As Long
dwFlags As TRACKMOUSEEVENT_FLAGS
hwndTrack As Long
dwHoverTime As Long
End Type
Public Enum ttIconType
TTNoIcon = 0
TTIconInfo = 1
TTIconWarning = 2
TTIconError = 3
End Enum
Public Enum ttStyleEnum
TTStandard
TTBalloon
End Enum
Private Enum GRADIENT_FILL_RECT
FillHor = GRADIENT_FILL_RECT_H
FillVer = GRADIENT_FILL_RECT_V
End Enum
Private Enum GRADIENT_TO_CORNER
All
TopLeft
TopRight
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -