By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,495 Members | 1,002 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,495 IT Pros & Developers. It's quick & easy.

Access recognising screen Res

P: n/a
Hi all,

I remember seeing somewhere some code that could be used for access to
automatically recognise the screen res of the computer it is being used on.
Anyone know where I can find it easily.

Much appreciated!
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
This is a piece of code I use to see what the resolution is.
Private Declare Function GetDeviceCaps Lib "gdi32" (ByVal hdc As Long, ByVal
nIndex As Long) As Long
Private Declare Function GetHDC Lib "user32" Alias "GetDC" (ByVal hwnd As
Long) As Long

Public Function GetScreenRes(Optional nGetVal As Integer = 1) As Long
'nGetVal : 1=Width 2=Height 3=Color 32=Dpi

Dim hdc As Long
Dim nIndex as Integer

hdc = GetHDC(hWndAccessApp)

nIndex = 6 + (nGetVal * 2)

GetScreenRes = GetDeviceCaps(hdc, nIndex)
End Function
Regards,
Kevin Rollo
Perth, Western Australia
"Scott" <sm****@ii.net> wrote in message
news:40***********************@freenews.iinet.net. au...
Hi all,

I remember seeing somewhere some code that could be used for access to
automatically recognise the screen res of the computer it is being used on. Anyone know where I can find it easily.

Much appreciated!

Nov 12 '05 #2

P: n/a
Kevin any time you GetDC you must at some point call ReleaseDC.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Kevin Rollo" <ke*@sickofspam.com> wrote in message
news:QB***************@news-server.bigpond.net.au...
This is a piece of code I use to see what the resolution is.
Private Declare Function GetDeviceCaps Lib "gdi32" (ByVal hdc As Long, ByVal nIndex As Long) As Long
Private Declare Function GetHDC Lib "user32" Alias "GetDC" (ByVal hwnd As Long) As Long

Public Function GetScreenRes(Optional nGetVal As Integer = 1) As Long
'nGetVal : 1=Width 2=Height 3=Color 32=Dpi

Dim hdc As Long
Dim nIndex as Integer

hdc = GetHDC(hWndAccessApp)

nIndex = 6 + (nGetVal * 2)

GetScreenRes = GetDeviceCaps(hdc, nIndex)
End Function
Regards,
Kevin Rollo
Perth, Western Australia
"Scott" <sm****@ii.net> wrote in message
news:40***********************@freenews.iinet.net. au...
Hi all,

I remember seeing somewhere some code that could be used for access to automatically recognise the screen res of the computer it is being
used on.
Anyone know where I can find it easily.

Much appreciated!



Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.