Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: VB4/32,VB5,VB6
Expertise: Intermediate
Mar 3, 2001

IsSystemFontSmall - Determine if system font is small or large

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
Const LOGPIXELSX = 88

Private 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
Francesco Balena
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date