How To Detect The Current System Screen Font

Notes seems to have a problem with displaying a graphical Navigator when
the User uses large fonts as system screen font.
Here's a function how to detect the current system screen font.
'[DECLARATION]
Declare Function GetDesktopWindow Lib "user32" () As Long
Declare Function GetDC Lib "user32" (Byval hwnd As Long) As Long
Declare Function GetDeviceCaps Lib "gdi32" (Byval hdc As Long, Byval nIndex As
Long) As Long
Declare Function ReleaseDC Lib "user32" (Byval hwnd As Long, Byval hdc As Long)
As Long

Const LOGPIXELSX = 88
Const LOGPIXELSY = 90


'[CLICK OR ANY OTHER EVENT]
Sub Click(Source As Button)
If IsScreenFontSmall() Then

Msgbox "The system is using Small fonts"
Else
Msgbox "The system is using Large fonts"

End If
End Sub


Private Function IsScreenFontSmall() As Variant

Dim hWndDesk As Long
Dim hDCDesk As Long
Dim logPix As Long

'get the handle to the desktop window
hWndDesk = GetDesktopWindow()

'get the handle desktop display context (hDC)
hDCDesk = GetDC(hWndDesk)

'get the horizontal logical pixels
logPix = GetDeviceCaps(hDCDesk, LOGPIXELSX)

'release the hDC
Call ReleaseDC(hWndDesk, hDCDesk)

'if the return from GetDeviceCaps is 96, then
'the system is using small fonts.
IsScreenFontSmall = logPix = 96

End Function
This was first published in November 2000

Dig deeper on Domino Resources - Part 7

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchWinIT

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchEnterpriseLinux

SearchVirtualDataCentre.co.UK

Close