How to Determine System Settings from VBA 
Author Message
 How to Determine System Settings from VBA

I would like to determine programatically the system settings from an
Access VBA module.  Specifically, I would like to base a decision on the
screen size/resolution setting.  Thanks for any help.
--
Dr. Douglas Paul Pruiett, D.Min.
Senior Chaplain, Brevard County Detention Center
P.O. Box 800
Sharpes, Florida  32959

Internet Page: http://www.*-*-*.com/ ~pruiett/index.htm



Tue, 29 Jan 2002 03:00:00 GMT  
 How to Determine System Settings from VBA
You'll need to use api calls.

Dev Ashish has what you need on his web site.
(http://home.att.net/~dashish/)

__
Here is the api info from his site that you'll need (From Dev's Site)
'***************** Code Start **********************
'
Private Declare Function apiGetSys Lib "user32" _
    Alias "GetSystemMetrics" (ByVal nIndex As Long) As Long

Private Const SM_CXSCREEN = 0
Private Const SM_CYSCREEN = 1
Private Const SM_CXVSCROLL = 2
Private Const SM_CYHSCROLL = 3
Private Const SM_CYCAPTION = 4
Private Const SM_CXBORDER = 5
Private Const SM_CYBORDER = 6
Private Const SM_CXDLGFRAME = 7
Private Const SM_CYDLGFRAME = 8
Private Const SM_CYVTHUMB = 9
Private Const SM_CXHTHUMB = 10
Private Const SM_CXICON = 11
Private Const SM_CYICON = 12
Private Const SM_CXCURSOR = 13
Private Const SM_CYCURSOR = 14
Private Const SM_CYMENU = 15
Private Const SM_CXFULLSCREEN = 16
Private Const SM_CYFULLSCREEN = 17
Private Const SM_CYKANJIWINDOW = 18
Private Const SM_MOUSEPRESENT = 19
Private Const SM_CYVSCROLL = 20
Private Const SM_CXHSCROLL = 21
Private Const SM_DEBUG = 22
Private Const SM_SWAPBUTTON = 23
Private Const SM_RESERVED1 = 24
Private Const SM_RESERVED2 = 25
Private Const SM_RESERVED3 = 26
Private Const SM_RESERVED4 = 27
Private Const SM_CXMIN = 28
Private Const SM_CYMIN = 29
Private Const SM_CXSIZE = 30
Private Const SM_CYSIZE = 31
Private Const SM_CXFRAME = 32
Private Const SM_CYFRAME = 33
Private Const SM_CXMINTRACK = 34
Private Const SM_CYMINTRACK = 35
Private Const SM_CXDOUBLECLK = 36
Private Const SM_CYDOUBLECLK = 37
Private Const SM_CXICONSPACING = 38
Private Const SM_CYICONSPACING = 39
Private Const SM_MENUDROPALIGNMENT = 40
Private Const SM_PENWINDOWS = 41
Private Const SM_DBCSENABLED = 42
Private Const SM_CMOUSEBUTTONS = 43
Private Const SM_CMETRICS = 44

Function fGetSysStuff(strWhat As String) As String
Dim strRet As String
    Select Case LCase(strWhat)
        Case "resolution": strRet = apiGetSys(SM_CXSCREEN) & "x" _
                                        & apiGetSys(SM_CYSCREEN)
        Case "windowsize": strRet = apiGetSys(SM_CXFULLSCREEN) & "x" _
                                        & apiGetSys(SM_CYFULLSCREEN)
    End Select
    fGetSysStuff = strRet
End Function
'***************** Code End **********************



Tue, 29 Jan 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Determining system color setting

2. Determining system color setting

3. Determining current system color setting

4. Determine System State in win2k and killing system

5. Excel/VBA graphics: Settings X-axis scale properties in VBA

6. Determine Operating System

7. Can VBScript determine the Client Operating System

8. Determining system language?

9. Determining system date format

10. Determining if system has Internet access

11. ##### How can I determine the system resources used by my Prog

12. How to determine if small/large system fonts

 

 
Powered by phpBB® Forum Software