I have VB6 code which detect windows font size(DPI) like following.
This code returns correctly in Windows XP.
(Small=96/Large=120)
But returns wrong result in Windows 7.
(Small=96/Medium=120/Large=96)
How do I get correct font DPI value in Windows 7?
Code:
Public Function GetFontSizeDPI() As Long
Dim hwnd As Long
Dim hdc As Long
Dim logPix As Long
Dim SmallFonts As Boolean
Dim LOGPIXELSX As Long
hwnd = GetDesktopWindow
hdc = GetDC(hwnd)
LOGPIXELSX = 88
logPix = GetDeviceCaps(hdc, LOGPIXELSX)
Call ReleaseDC(hwnd, hdc)
GetFontSizeDPI = logPix
End Function
(Small=96/Large=120)
But returns wrong result in Windows 7.
(Small=96/Medium=120/Large=96)
How do I get correct font DPI value in Windows 7?