devxlogo

IsSystemFontSmall – Determine if system font is small or large

IsSystemFontSmall – Determine if system font is small or large

Private Declare Function GetDesktopWindow Lib "user32" () As LongPrivate Declare Function GetDC Lib "user32" (ByVal hWnd As Long) As LongPrivate Declare Function GetDeviceCaps Lib "gdi32" (ByVal hDC As Long, _    ByVal nIndex As Long) As LongPrivate Declare Function ReleaseDC Lib "user32" (ByVal hWnd As Long, _    ByVal hDC As Long) As LongConst LOGPIXELSX = 88Private Function IsSystemFontSmall() As Boolean    Dim hWnd As Long, hDC As Long        ' get the handle of the desktop window    hWnd = GetDesktopWindow()    ' get its device context    hDC = GetDC(hWnd)    ' if the number of pixels per logical inch is = 96    ' then Windows is using small system font    IsSystemFontSmall = (GetDeviceCaps(hDC, LOGPIXELSX) = 96)    ' release the device context    ReleaseDC hWnd, hDC    End Function

See also  Why ChatGPT Is So Important Today
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist