Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

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



Application Security Testing: An Integral Part of DevOps

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

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.



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