Determining Whether The Large Fonts Option Is
Enabled
The Display Panel Control Applet contains an option to use
Small or Large Fonts.With the following
function you can determine whether this has been enabled or not. If 'True' is returned
then large fonts are in use and 'False' if not.
Type TEXTMETRIC
tmHeight As Integer
tmAscent As Integer
tmDescent As Integer
tmInternalLeading As Integer
tmExternalLeading As Integer
tmAveCharWidth As Integer
tmMaxCharWidth As Integer
tmWeight As Integer
tmItalic As String * 1
tmUnderlined As String * 1
tmStruckOut As String * 1
tmFirstChar As String * 1
tmLastChar As String * 1
tmDefaultChar As String * 1
tmBreakChar As String * 1
tmPitchAndFamily As String * 1
tmCharSet As String * 1
tmOverhang As Integer
tmDigitizedAspectX As Integer
tmDigitizedAspectY As Integer
End Type
Public Declare Function GetWindowDC Lib "user32" (ByVal hwnd As Long) As Long
Declare Function GetTextMetrics Lib "gdi32" Alias "GetTextMetricsA"
(ByVal hdc As Long, lpMetrics As TEXTMETRIC) As Long
Declare Function GetDesktopWindow Lib "user32" () As Long
Declare Function ReleaseDC Lib "user32" (ByVal hwnd As Long, ByVal hdc As Long)
As Long
Public Function IsLargeFonts() As Boolean
Dim lhDC, lTemp As Long, tTextMetric As TEXTMETRIC
lhDC = GetWindowDC(GetDesktopWindow())
GetTextMetrics lhDC, tTextMetric
ReleaseDC GetDesktopWindow(), lhDC
IsLargeFonts = CBool((tTextMetric.tmHeight - 16))
End Function
Home |