Size of Access Window?- GetSystemMetrics??

G

Guest

Trying to get the size of the Access work area i.e. the size of the Maximized Window minus the TitleBar, MenuBar,
ToolBar(s), StatusBar and TaskBar (if its on that monitor

the code I have measures the entire screen

AccWinWidth = fPixelsToTwips(GetSystemMetrics(SM_CXSCREEN), "X") ' <--- use other call for app's window are
AccWinHeight = fPixelsToTwips(GetSystemMetrics(SM_CYSCREEN), "Y"

Isn't there a way to get the size of the Client Area (am I using the right word?) of the Access window directly?
aha tia, blm
 
S

Stephen Lebans

You would use the GetClientRect API.

Private Declare Function GetClientRect Lib "user32" _
(ByVal hWnd As Long, lpRect As RECTL) As Long

Public Type RECTL
Left As Long
top As Long
right As Long
Bottom As Long
End Type


' Client Window extents
Dim rcClient As RECTL


' For a Form we would make the call like :
' Get the Client Rectangle for our Form
lngRet = GetClientRect(frm.hWnd, rcClient)


Perhaps though, what you are really after are the window extents of the
MDIClient window. There are examples on my site of how to obtain this
info. Have a look here:
http://www.lebans.com/saverelationshipview.htm


--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


blm said:
Trying to get the size of the Access work area i.e. the size of the
Maximized Window minus the TitleBar, MenuBar,
ToolBar(s), StatusBar and TaskBar (if its on that monitor)

the code I have measures the entire screen:

AccWinWidth = fPixelsToTwips(GetSystemMetrics(SM_CXSCREEN), "X") '
<--- use other call for app's window area
AccWinHeight = fPixelsToTwips(GetSystemMetrics(SM_CYSCREEN), "Y")

Isn't there a way to get the size of the Client Area (am I using the
right word?) of the Access window directly?
 
S

Stephen Lebans

Since you are obviously starting from scratch here I'd advise you to try
and find an existing solution. It's not that Windows GDI stuff is too
complex it's just that the initial learning curve is very steep.
Have a look at the window class on dev's site here:
http://www.mvps.org/access/forms/frm0042.htm

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


blm said:
ok, it took a while because, well, I don't understand your code. (you
API-call guys are a little ahead of me)
I've read your post, and I have no idea what to do with a RECTL
object. (I just hope that doesn't stand for rectal) And I've downloaded
your Relationship MDB, but I can't seem to find anything I'm looking for
in there, (although I'm sure it is)
It sounds like I AM looking for the dimensions of the MDI client
window, Specifically I need the hieght and width as seperate integers
(longs?) so I can .move some forms around accordingly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top