Private Declare Function CloseThemeData Lib "uxtheme.dll" (ByVal hTheme As Long) As Long
Private Declare Function DrawThemeBackground Lib "uxtheme.dll" (ByVal hTheme As Long, ByVal lhDC As Long, ByVal iPartId As Long, ByVal iStateId As Long, pRect As CfRECT, pClipRect As CfRECT) As Long
Private Declare Function OpenThemeData Lib "uxtheme.dll" (ByVal hWnd As Long, ByVal pszClassList As Long) As Long
Private Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, ByVal yPoint As Long) As Long
Private Declare Function GetWindowRect Lib "user32" (ByVal hWnd As Long, lpRect As CfRECT) As Long
Private Declare Function SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Private Declare Function GetFocus Lib "user32.dll" () As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As CfPOINTAPI) As Long
Private Declare Function DrawEdge Lib "user32" (ByVal hDC As Long, Qrc As CfRECT, ByVal Edge As CfBdrStyle, ByVal grfFlags As CfEdgeStyle) As Long
Private Declare Function SetRect Lib "user32.dll" (ByRef lpRect As CfRECT, ByVal rLeft As Long, ByVal rTop As Long, ByVal rRight As Long, ByVal rBottom As Long) As Long
Private Declare Function FillRect Lib "user32.dll" (ByVal hDC As Long, ByRef lpRect As CfRECT, ByVal hBrush As Long) As Long
Private Declare Function FrameRect Lib "user32.dll" (ByVal hDC As Long, ByRef lpRect As CfRECT, ByVal hBrush As Long) As Long
Private Declare Function CreateSolidBrush Lib "gdi32.dll" (ByVal crColor As Long) As Long
Private Declare Function DeleteObject Lib "gdi32.dll" (ByVal hObject As Long) As Long
Private Declare Function PtInRect Lib "user32.dll" (ByRef lpRect As CfRECT, ByVal X As Long, ByVal Y 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 SetPixel Lib "gdi32.dll" (ByVal hDC As Long, ByVal X As Long, ByVal Y As Long, ByVal crColor As Long) As Long
Private Declare Function DrawText Lib "user32.dll" Alias "DrawTextA" (ByVal hDC As Long, ByVal lpStr As String, ByVal nCount As Long, lpRect As CfRECT, ByVal wFormat As Long) As Long
Private Declare Sub CopyMem Lib "kernel32" Alias "RtlMoveMemory" (pDest As Any, pSrc As Any, ByVal lByteLen As Long)
Private Declare Function GetMessage Lib "user32" Alias "GetMessageA" (lpMsg As tMSG, ByVal hWnd As Long, ByVal wMsgFilterMin As Long, ByVal wMsgFilterMax As Long) As Long
Private Declare Function TranslateMessage Lib "user32" (lpMsg As tMSG) As Long
Private Declare Function DispatchMessage Lib "user32" Alias "DispatchMessageA" (lpMsg As tMSG) As Long
Private Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal hkey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Private Declare Function RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" (ByVal hkey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, lpData As Any, lpcbData As Long) As Long
Private Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hkey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Const HWND_TOP As Long = 0
Private Const HWND_BOTTOM As Long = 1
Private Const HWND_TOPMOST = -1
Private Const HWND_NOTOPMOST = -2
Private Const SWP_NOACTIVATE = &H10
Private Const SWP_SHOWWINDOW = &H40
Private Const SWP_FRAMECHANGED As Long = &H20
Private Const GWL_EXSTYLE = (-20)
Private Const WS_EX_TOOLWINDOW = &H80
Private Const DT_BOTTOM = &H8
Private Const DT_CALCRECT = &H400
Private Const DT_CENTER = &H1
Private Const DT_EXPANDTABS = &H40
Private Const DT_EXTERNALLEADING = &H200
Private Const DT_LEFT = &H0
Private Const DT_NOCLIP = &H100
Private Const DT_NOPREFIX = &H800
Private Const DT_RIGHT = &H2
Private Const DT_SINGLELINE = &H20
Private Const DT_TABSTOP = &H80
Private Const DT_TOP = &H0
Private Const DT_VCENTER = &H4
Private Const DT_WORDBREAK = &H10
Private Const DT_WORD_ELLIPSIS As Long = &H40000
Private Const ERROR_SUCCESS = 0&
Private Const WM_SETFOCUS As Long = &H7
Private Const WM_MOUSEWHEEL = 522
Private Const PM_REMOVE = &H1
Public Enum CfBdrStyle
sNone = 0
sRaised = &H1 Or &H4
sSunken = &H2 Or &H8
sBump = &H1 Or &H8
sEtched = &H2 Or &H4
sSmoothRaised = &H4
sSmoothSunken = &H2
End Enum
Public Enum CfEdgeStyle
edgeAll = &HF
edgeLeft = &H2
edgeTop = &H4
edgeRight = &H1
edgeBottom = &H8
End Enum
Public Enum HkeyLoc2
HKEY_CLASSES_ROOT = &H80000000
HKEY_CURRENT_USER = &H80000001
HKEY_LOCAL_MACHINE = &H80000002
HKEY_USERS = &H80000003
HKEY_DYN_DATA = &H80000004
End Enum
Private Enum eBtnState
bUp = 0
bOver = 1
bDown = 2
End Enum
Private Enum sTxtPosition
TopLeft = 0
TopCenter = 1
TopRight = 2
MiddleLeft = 3
MiddleCenter = 4
MiddleRight = 5
BottomLeft = 6
BottomCenter = 7
BottomRight = 8
End Enum
Private Enum HkeyLoc
HKEY_CLASSES_ROOT = &H80000000
HKEY_CURRENT_USER = &H80000001
HKEY_LOCAL_MACHINE = &H80000002
HKEY_USERS = &H80000003
HKEY_DYN_DATA = &H80000004
End Enum
Private Type CfRECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Type tpRecents
fName As String
fIndex As String
fRecent As Boolean
End Type
Private Type CfPOINTAPI
X As Long
Y As Long
End Type
Private Type tMSG
hWnd As Long
nMsg As Long
wParam As Long
lParam As Long
time As Long
pt As CfPOINTAPI
End Type
Private Msg As tMSG
Public Event SelectedFontChanged(NewFontName As String)
Public Event Click()
Public Event DblClick()
Public Event KeyDown(KeyCode As Integer, Shift As Integer)
Public Event KeyPress(KeyAscii As Integer)
Public Event KeyUp(KeyCode As Integer, Shift As Integer)
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)
Public Event FontNotFound(FontName As String)
Public Function FontExist(Font2Find As String, Optional StartPos As Integer = 0) As Integer
Dim I As Integer
FontExist = -1
For I = StartPos To mListCount
If LCase(mListFont(I)) Like LCase(Font2Find) Then
FontExist = I
Exit For
End If
Next I
End Function
Private Function DrawTheme(sClass As String, ByVal iPart As Long, ByVal iState As Long, rtRect As CfRECT) As Boolean