473,385 Members | 1,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Access recognising screen Res

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
2 1540
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Phil | last post by:
Hi all, I need some help to access an SQL db on another machine. I am using VB.NET and remoting to make a client/server connection...although I don't think this is relevant to the question. I...
5
by: Philippa | last post by:
I'm trying to access data in vba using the openrecordset command. The data in on a SQL Server 2000 database, and I have linked tables to that data. the Table I'm trying to access is one of these...
2
by: Shaun | last post by:
Ok here is the situation… Have an access 20002 application that I'm converting to have a SQL Server backend (2000), the application has been in use with an access backend for years, no real...
2
by: Scott | last post by:
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....
20
by: Olav.NET | last post by:
I am a .NET/C++ developer who is supposed to do some work with Access. I do not know much about it except for the DB part. Questions: *1* I am looking for INTENSIVE books to get quickly up to...
1
by: com | last post by:
Extreme Web Reports 2005 - Soft30.com The wizard scans the specified MS Access database and records information such as report names, parameters and subqueries. ......
3
by: ferg | last post by:
Hey folks, I'm new to this malarky, but I can't find anywhere an example of programmatically recognising which tab a user has clicked. I know it's something to do with the SelectedIndex property...
27
by: Wayne | last post by:
I've been clicking around Access 2007 Beta 2 and can't see the custom menu bar designer. Is it in the beta? Maybe I'm blind. The question that comes to mind is: Will custom menu bars be the same...
15
by: ApexData | last post by:
Hello I'm using Access2000, SplitDB, ALL MenuBars are Off. The AccessTitleBar(BlueBar) displays at the top with its (Min/Max/) Controlbox. I have a MainMenuForm (Modal-On), that Calls a...
0
by: teju | last post by:
Hi all, I have written a script which alerts on when the website is down.I have used XMLHTTP object and screen scraping the error and alerting it.But, sometimes it gives wrong alerts reason being...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.