By submitting your personal information, you agree that TechTarget and its partners may contact you regarding relevant content, products and special offers.
the User uses large fonts as system screen font.
Here's a function how to detect the current system screen font.
Declare Function GetDesktopWindow Lib "user32" () As Long
Declare Function GetDC Lib "user32" (Byval hwnd As Long) As Long
Declare Function GetDeviceCaps Lib "gdi32" (Byval hdc As Long, Byval nIndex As
Long) As Long
Declare Function ReleaseDC Lib "user32" (Byval hwnd As Long, Byval hdc As Long)
Const LOGPIXELSX = 88
Const LOGPIXELSY = 90
'[CLICK OR ANY OTHER EVENT]
Sub Click(Source As Button)
If IsScreenFontSmall() Then
Msgbox "The system is using Small fonts"
Msgbox "The system is using Large fonts"
Private Function IsScreenFontSmall() As Variant
Dim hWndDesk As Long
Dim hDCDesk As Long
Dim logPix As Long
'get the handle to the desktop window
hWndDesk = GetDesktopWindow()
'get the handle desktop display context (hDC)
hDCDesk = GetDC(hWndDesk)
'get the horizontal logical pixels
logPix = GetDeviceCaps(hDCDesk, LOGPIXELSX)
'release the hDC
Call ReleaseDC(hWndDesk, hDCDesk)
'if the return from GetDeviceCaps is 96, then
'the system is using small fonts.
IsScreenFontSmall = logPix = 96