Hey there...
I haven't a clue how to find out the screen size the monitor size (15", 17", 19" etc...)
Anyone can help?
Tnx,
keetsh
Printable View
Hey there...
I haven't a clue how to find out the screen size the monitor size (15", 17", 19" etc...)
Anyone can help?
Tnx,
keetsh
You can't I'm afraid, the moiter doesn't give any information to the computer about what size it is, the graphics card doesn't need to know how big the screen is, the monitor handles it all.
But you can use screen.height and screen.width to determin (i think) resolution.
Well thanks Sam but I've seen a program getting that info... so I was quite surprised... Because I've to find out how many pixels make an inch and so.
See you,
keetsh®
I suppose that if the monitor was an installed P&P monitor then it may be stored in the registry but most systems are like mine "Unknown Monitor" the system really doesn't know or care how many inches (or centermeters in some countries) it is. The graphics card sends raster data in it's configured resolution type and the monitor does the rest.
In fact it makes no difference if a monitor is not even connected.
There maybe some monitors that come with software which it specifically talks to....
but if you send me a piece of code that can tell me how big my monitor is I'll be VERY impressed.
Yes Paul the computer does determine whether the monitor is connected or not. I'm gonna have look in the registry and keep you up to date with this.
See you,
keetsh
No it doesn't !
If the computer knew what the monitor was doing and displaying you wouldn't have test screens in NT and 15sec wait intervals in 95' to let the use tell the OS what is happening.
Apple MACs used to have something like that though
Well,
I'm not sure though because I once bugged mine when I unplugged my monitor and ran Windows. It was Win98 though... anyway that's not quite the matter of the subject.. I'll mail you when I finish something kewl... :)
See you,
keetsh
No guarantees as to the reliablity of this method.
Wait, I take that back.
I guarantee this method is as reliable as Win95 is after it's been running for a week.
If you get a screen device context (GetDC(0)), theres a function called GetDeviceCaps that retrieves information on the device context's capabilities (bits per pixel, etc).
Some potentially useful requests:
HORZSIZE Width, in millimeters, of the physical screen.
VERTSIZE Height, in millimeters, of the physical screen.
LOGPIXELSX Number of pixels per logical inch along the screen width. In a system with multiple display monitors, this value is the same for all monitors.
LOGPIXELSY Number of pixels per logical inch along the screen height. In a system with multiple display monitors, this value is the same for all monitors.
Usually, you want to find out resolution instead of actual screen size. For example, one of our programs is designed to be run on laptops and must be run at 1024x768. We use the following function:
As long as the display is set at 1024x768, we don't care if its a 14" or 12" or even a 9" display panel.Code:Function checkScreenRes(stringIn As String) As Boolean
Select Case stringIn
Case "1024x768"
If Screen.Width / Screen.TwipsPerPixelX >= 1024 And _
Screen.Height / Screen.TwipsPerPixelY >= 768 Then
checkScreenRes = True
Else
checkScreenRes = False
End If
' TODO: Add other screen sizes here as Cases
End Select
End Function
Hope that helps.
-John