Jim Dettman
jimdettman at earthlink.net
Fri Jul 18 07:37:41 CDT 2003
<<However, this gets me a detail section size that is almost, but not
quite, right. Its out by about 1cm! >>
Sounds suspiciously like the amount of space for a toolbar.
Jim Dettman
President,
Online Computer Services of WNY, Inc.
(315) 699-3443
jimdettman at earthlink.net
-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Bruce Bruen
Sent: Friday, July 18, 2003 8:27 AM
To: accessd at databaseadvisors.com
Subject: [AccessD] For API experts only
Hey list,
Can anyone tell me what units the following call returns:
Private Declare Function GetClientRect Lib "user32.dll" (ByVal
hwnd As Long, lpRect As RECT) As Long
Private Type RECT
wLeft As Long
wTop As Long
wRight As Long
wBottom As Long
End Type
I am trying to set a form detail section height to the maximum available
height in the access client window. To do this I am using
Private Declare Function GetParent Lib "user32.dll" (ByVal hwnd
As Long) As Long
to get the forms parent window, which appears to have the same hwnd as
the Access app MDI client ( as per the Ashsish/Kreft class info wizard),
and which I thus presume is the window I am looking for. Then I treat
it thus:
lRtn = GetClientRect(GetParent(Me.hwnd), wParRECT)
wincliHeight = wParRect.wBottom * TwipsPerPixelY
Where
Function TwipsPerPixelY() As Single
'Returns the height of a pixel, in twips.
' This code is from the great but defunct AllAPI team, I think.
Const HWND_DESKTOP As Long = 0
Const LOGPIXELSY As Long = 90
Dim lngDC As Long
lngDC = GetDC(HWND_DESKTOP)
TwipsPerPixelY = 1370& / GetDeviceCaps(lngDC, LOGPIXELSY)
'LOGPIXELSY= Number of pixels per logical inch along the screen height.
ReleaseDC HWND_DESKTOP, lngDC
End Function
However, this gets me a detail section size that is almost, but not
quite, right. Its out by about 1cm!
The screen is running at 1024x768 res. TwipsPerPixelY returns
14.something.
Any ideas?
Tia
Bruce
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com