Here is some sample code I used which should help you...
Option Explicit
Private Const LOGPIXELSX = 88
Private Const LOGPIXELSY = 90
Private Declare Function GetDesktopWindow Lib "user32" () 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
Private Declare Function ReleaseDC Lib "user32" _
(ByVal hwnd As Long, ByVal hdc As Long) As Long
Private Sub Command1_Click()
'call the wrapper function
If IsScreenFontSmall() Then
Label1.Caption = "The system is using Small fonts"
Else
Label1.Caption = "The system is using Large fonts"
End If
End Sub
Private Function IsScreenFontSmall() As Boolean
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
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.