* "Lance" <zi***@hotmail.com> scripsit:
Is there a way to obtain the system DPI settings? (i.e.,
the value that is set under Display Properties - Settings
Tab - Advanced... - General Tab - Font Size.)
Untested, quick and dirty:
\\\
Private Declare Auto Function GetDesktopWindow Lib "user32.dll" ( _
) As IntPtr
Private Declare Auto Function GetDC Lib "user32.dll" ( _
ByVal hWnd As IntPtr _
) As IntPtr
Private Declare Auto Function GetDeviceCaps Lib "gdi32.dll" ( _
ByVal hdc As IntPtr, _
ByVal nIndex As Int32 _
) As Int32
Private Declare Auto Function ReleaseDC Lib "user32.dll" ( _
ByVal hWnd As IntPtr, _
ByVal hdc As IntPtr _
) As Int32
Private Function SmallFonts() As Boolean
Dim hWndDesktop As IntPtr, hDCDesktop As IntPtr
Dim PixelsX As Int32
hWndDesktop = GetDesktopWindow
hDCDesktop = GetDC(hWndDesktop)
PixelsX = GetDeviceCaps(hDCDesktop, 88)
ReleaseDC(hWndDesktop, hDCDesktop)
SmallFonts = (PixelsX = 96)
End Function
///
--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>