Private Declare Function ChooseFont Lib "comdlg32.dll" Alias "ChooseFontA" (pChoosefont As CHOOSEFONTX) As Long
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetDeviceCaps Lib "gdi32" (ByVal hdc As Long, ByVal nIndex As Long) As Long
Const LF_FACESIZE = 32
Const LOGPIXELSX = 88
Const LOGPIXELSY = 90
Const HORZRES = 8
Const HORZSIZE = 4
Const VERTRES = 10
Const VERTSIZE = 6
' size = 60
Private Type LOGFONT
lfHeight As Long
lfWidth As Long
lfEscapement As Long
lfOrientation As Long
lfWeight As Long
lfItalic As Byte
lfUnderline As Byte
lfStrikeOut As Byte
lfCharSet As Byte
lfOutPrecision As Byte
lfClipPrecision As Byte
lfQuality As Byte
lfPitchAndFamily As Byte
' lfFaceName As String * 32
lfFaceName(LF_FACESIZE) As Byte
End Type
' size = 60
Private Type CHOOSEFONTX
lStructSize As Long
hwndOwner As Long ' caller's window handle
hdc As Long ' printer DC/IC or NULL
lpLogFont As Long ' ptr. to a LOGFONT struct
iPointSize As Long ' 10 * size in points of selected font
flags As Long ' enum. type flags
rgbColors As Long ' returned text color
lCustData As Long ' data passed to hook fn.
lpfnHook As Long ' ptr. to hook function
lpTemplateName As String ' custom template name
hInstance As Long ' instance handle of.EXE that
' contains cust. dlg. template
lpszStyle As String ' return the style field here
' must be LF_FACESIZE or bigger
nFontType As Integer ' same value reported to the EnumFonts
' call back with the extra FONTTYPE_
' bits added
MISSING_ALIGNMENT As Integer
nSizeMin As Long ' minimum pt size allowed &
nSizeMax As Long ' max pt size allowed if
' CF_LIMITSIZE is used
End Type
Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" _
(ByVal lpPrevWndFunc As Long, _
ByVal hwnd As Long, ByVal Msg As Long, _
ByVal wParam As Long, ByVal lParam As Long) As Long
Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" ( _
hpvDest As Any, hpvSource As Any, ByVal cbCopy 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 Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Const GWL_WNDPROC = (-4)
Const WM_MOUSEMOVE = &H200
Const WM_MOUSEACTIVATE = &H21
Const WM_LBUTTONDBLCLK = &H203
Const WM_LBUTTONDOWN = &H201
Const WM_LBUTTONUP = &H202
Const WM_KEYDOWN = &H100
Const WM_KEYUP = &H101
Const WM_RBUTTONDOWN = &H204
Const WM_RBUTTONUP = &H205
Const WM_NOTIFY = &H4E
Const WM_COMMAND = &H111
Const TPM_CENTERALIGN = &H4&
Const TPM_LEFTALIGN = &H0&
Const TPM_LEFTBUTTON = &H0&
Const TPM_RIGHTALIGN = &H8&
Const TPM_RIGHTBUTTON = &H2&
Const EN_MSGFILTER = &H700
Const EN_SELCHANGE = &H702
Type NMHDR
hwndFrom As Long
idfrom As Long
code As Long
End Type
Type CHARRANGE
cpMin As Long
cpMax As Long
End Type
Type SELCHANGE
nmhdrx As NMHDR
chrg As CHARRANGE
seltype As Integer
End Type
Type MSGFILTER
nmhdrx As NMHDR
Msg As Integer
pad1 As Integer
wParam As Integer
pad2 As Integer
lParam As Long
End Type
Const MF_BYPOSITION = &H400&
' this is the structure used to send formatting information