Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get point size

Status
Not open for further replies.

RapidE

Programmer
Oct 16, 2003
4
SK
Does anybodu know how can I get the point size (heigth & width) of CRT monitor or LCD display?

Many thanks
Vlado
 
Screen.Width / Screen.TwipsPerPixelX
Screen.Height / Screen.TwipsPerPixelY

will give the size in pixels. Or you can get the size of the desktop window in pixels using API functions:
Code:
Type RECT
 Left As Long
 Top As Long
 Right As Long
 Bottom As Long
End Type

Declare Function GetDesktopWindow Lib "user32" _
Alias "GetDesktopWindow" () As Long

Declare Function GetClientRect Lib "user32" _
Alias "GetClientRect" (Byval hwnd As Long, _
lpRect As RECT) As Long
'________________________

Dim udtClientRect As RECT
GetClientRect GetDesktopWindow(), udtClientRect
Debug.Print "Width: " & udtClientRect.Bottom
Debug.Print "Height: " & udtClientRect.Right

Paul Bent
Northwind IT Systems
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top