VB The properties Screen.TwipsPerPixelX and Screen.TwipsPerPixelY are missing in MS Access. is there any way to replace them?

Here's the code:
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function ReleaseDC Lib "user32" (ByVal hwnd As Long, ByVal hDC As Long) As Long
Private Declare Function GetDeviceCaps Lib "gdi32" (ByVal hDC As Long, ByVal nIndex As Long) As Long
Private Const LOGPIXELSX = 88
Private Const LOGPIXELSY = 90
' Converts twips corrdinates to pixels coordinates
Private Sub Twips2Pixels(X As Long, Y As Long)
Dim hDC As Long
hDC = GetDC(0)
X = X / 1440 * GetDeviceCaps(hDC, LOGPIXELSX)
Y = Y / 1440 * GetDeviceCaps(hDC, LOGPIXELSY)
ReleaseDC 0, hDC
End Sub
view raw screen_props.vb hosted with ❤ by GitHub

Komentar