Private Declare Function GetTextMetrics Lib "gdi32" Alias "GetTextMetricsA" (ByVal hdc As Long, lpMetrics As TEXTMETRIC) As Long
Private Declare Function GetWindowDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function SetMapMode Lib "gdi32" (ByVal hdc As Long, ByVal nMapMode As Long) As Long
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Public Function SmallFonts() As Boolean
Dim hdc As Long
Dim hwnd As Long
Dim PrevMapMode As Long
Dim tm As TEXTMETRIC
' Sätt default returvärde till small fonts
SmallFonts = True
' Hämta handle på desktop window
hwnd = GetDesktopWindow()
' Hämta device context för desktop
hdc = GetWindowDC(hwnd)
If hdc Then
' Sätt mapp mode till pixels
PrevMapMode = SetMapMode(hdc, MM_TEXT)
' Hämta storleken på systemfont
GetTextMetrics hdc, tm
' Återställ mapp mode
PrevMapMode = SetMapMode(hdc, PrevMapMode)
' Släpp device context
ReleaseDC hwnd, hdc
' Om systemfonten är större än 16 pixels,
' används stora fonter.
If tm.tmHeight > 16 Then SmallFonts = False
End If
End Function