|
-
May 1st, 2000, 04:48 AM
#1
Thread Starter
Member
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
-
May 1st, 2000, 05:58 AM
#2
Frenzied Member
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.
-
May 1st, 2000, 08:06 AM
#3
But you can use screen.height and screen.width to determin (i think) resolution.
-
May 1st, 2000, 05:57 PM
#4
Thread Starter
Member
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®
-
May 1st, 2000, 06:35 PM
#5
Fanatic Member
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.
Paul Dwyer 
Network Engineer
Aussie In Tokyo
Using Powerbasic 6 & VB6 SP4 (Please also add your VB Version to your signature!)
-
May 1st, 2000, 10:58 PM
#6
Thread Starter
Member
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
-
May 1st, 2000, 11:09 PM
#7
Fanatic Member
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
Paul Dwyer 
Network Engineer
Aussie In Tokyo
Using Powerbasic 6 & VB6 SP4 (Please also add your VB Version to your signature!)
-
May 1st, 2000, 11:18 PM
#8
Thread Starter
Member
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
-
May 2nd, 2000, 09:07 PM
#9
Lively Member
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.
- Steve
Real programmers use COPY CON PROGRAM.EXE
-
May 2nd, 2000, 09:33 PM
#10
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:
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
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.
Hope that helps.
-John
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|