Determining Screen Size and Resizing Application

J

John C.

I have a form which contains a 'timer'. It updates the
amount of time that has passed after the user starts it.
The DB will be converted to MDE after completion of code
developement.

I have been attempting to use an API call to determine
screen size.

Declare Function GetSystemMetrics& Lib "User32" (ByVal
nIndex&)
Const SM_CXSCREEN = 0 ' Width of screen
Const SM_CYSCREEN = 1 ' Height of screen
Const SM_CXFULLSCREEN = 16 ' Width of window client area
Const SM_CYFULLSCREEN = 17 ' Height of window client area
Const SM_CXFRAME = 32 ' Width of window frame
Const SM_CYFRAME = 33 ' Height of window frame

When I pass any of the listed constants to the function,
they all return 1024.

My current display is 1024 x 768.

Q:
(1) What could I be doing wrong? I have confirmed spelling
of constants.
(2) Of the listed constants, which one do I really want to
use to determine screen size?
(3) Can I make the MDE as 'on-top-always'?
(4) How do I resize the application to the size of the
form, which is relatively small?

Thankyou.
 
J

John C.

I am able to determine screen size and the usable
width/height now.

(1) How can I determine form height/width so that I can
resize the application and place it in the lower right
area of the screen?

(2) Can I make the MDE as 'on-top-always'?
(3) How do I resize the application to the size of the
form, which is relatively small?

Thankyou.
 
J

John C.

S

Silvester

A better solution is found free on the companion CD with the book Access
2000 Developer's Handbook Vol 1 by Getz & Litwin
 
P

Peter De Baets

(1) How can I determine form height/width so that I can
resize the application and place it in the lower right
area of the screen?

Here are some window manipulation examples that may help:
http://www.peterssoftware.com/winmanip.htm
(2) Can I make the MDE as 'on-top-always'?

This API might help:

Private Declare Function SetForegroundWindow& Lib "user32" (ByVal hwnd
As Long)

.... then use it in your form module like so:

SetForegroundWindow (Me.hwnd)
(3) How do I resize the application to the size of the
form, which is relatively small?

Some of the Winmanip examples might help with this. You can also
resize/rescale the form to fit the Access window with a form rescaling
utility like one of these:

ShrinkerStretcher: http://www.peterssoftware.com/ss2.htm

FMS sizer module at www.fmsinc.com.

The Access Developer's Handbook has form resizing code included:
http://www.amazon.com/exec/obidos/ISBN=0782119417/107-8064361-7403703

Hope this helps,

Peter De Baets
Peter's Software - MS Access Tools for Developers
http://www.peterssoftware.com
 

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