I think maintaining two front-ends is a horrible idea, but it's your workday.  I design everything at 800 x 600 unless the client specifically asks for/agrees to be tethered to 1024 x 768. 
 
I don't know of a way to read the resolution via DOS, but you certainly can via this API:
 
'***** code start *****'
Private Declare Function api_GetDeviceCaps Lib "gdi32" Alias "GetDeviceCaps" (ByVal hdc As Long, ByVal nIndex As Long) As Long
 
Public Function atGetdevcaps%(ByVal intCapability%)
'===========================================================
' Purpose:      Returns information on the capabilities of
'               a given device. Which device is determined
'               by the arguments to api_CreateIC. Which
'               capability is determined by the intCapability
'               argument which is one of the constants
'               defined for the GetDeviceCaps Windows API
'               function.
' Arguments:    intCapability - index of capability to check
'               see win32api.txt for list of values
' Returns:      Results of call to GetDeviceCaps
'-----------------------------------------------------------
On Error GoTo getdevcapsError
'LogPixels X = 88 for capability
'LogPixels Y = 90 for capability
 
Dim hdc&  'handle for the device context
'Specify the device -- use "DISPLAY' to check screen capabilities
Const DRIVER_NAME = "DISPLAY"
Const DEVICE_NAME = 0&
Const OUTPUT_DEVICE = 0&
Const LPDEVMODE = 0&
 
'Get a handle to a device context (hDC)
hdc = api_CreateIC(DRIVER_NAME, DEVICE_NAME, OUTPUT_DEVICE, LPDEVMODE)
If hdc > 0 Then
    'If a valid hDC was returned, call GetDeviceCaps and then release the DC
    atGetdevcaps = api_GetDeviceCaps(hdc, intCapability)
    hdc = api_DeleteDC(hdc)
End If
 
getdevcapsExit:
    Exit Function
getdevcapsError:
    MsgBox "Error: " & Error$, 48, "System Information"
    Resume getdevcapsExit
End Function
'***** code end *****'
 
atGetdevcaps(10) will give you the vertical
atGetdevcaps(8) will give you the horizontal
 
...however, I've found that the horizontal is quirky.  It works very well as the source of a form textbox, but running it in the immediate window (or in code), it will return 0 about half the time.  I hack around this by looping about 5 times, until it's non-zero - this has worked very consistently. 
 
Anyway, back to your problem, you could have them start an external Access or VB file that uses this API to read the resolution and open the appropriate file. 
 

Tom Oakes
Personal PC Consultants, Inc.
[EMAIL PROTECTED]
503.230.0911 (O)
402.968.6946 (C)
734.264.0911 (F)


 


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of jmw95823
Sent: Friday, August 05, 2005 10:14 AM
To: [email protected]
Subject: [AccessDevelopers] Determining Screen Resolution Via a Batch File

We've played around a bit with changing the size of controls on a
form
based on users' screen resolution(s).  We still need to work with it
some more to get it right because we had some problems with it.
Temporarily I was thinking that I might resize the forms to fit
1024x768 and make that a second front-end in addition to the original
designed at 800x600. 
We have a batch file that looks at the network to determine if there
is a newer version of the front end on the user's pc.  If there is,
the new version is copied to the local drive.
In this startup batch file is there some code I could use to
determine
the user's screen resolution and then have it open the mdb that
corresponds to it?  Thanks for any help.  Jim





Please zip all files prior to uploading to Files section.




YAHOO! GROUPS LINKS




Reply via email to