kiranreddys.com
Kiran's personal website
Blog   Forums   Sitemap   Links   
 
 
 
Knowledgebase
 
Home
Knowledge base home, and site home.
Categories
List of all Knowledge base categories.
Glossary
An alphabetical list of technical terms.
Contact Me
Contact me for knowledge base questions
My Blog
My articles, white papers, ideas and thoughts.
 

 
 


Getting Screen Resolution

'Getting Screen Resolution

'Code By Kiran Reddy
'Getting Screen Resolution
'You can get screen resolution in two ways
'One is using GetSystemMetrics another is using TwipsPerPixel
'Declaration

Private Declare Function GetSystemMetrics Lib "user32.dll" (ByVal nIndex As Long) As Long
Private Const SM_CXSCREEN = 0
Private Const SM_CYSCREEN = 1

Private Sub Form_Load()
'getting screen resolution with GetSystemMetrics
MsgBox "Current Screen Resolution is " & GetSystemMetrics(SM_CXSCREEN) & " x " & GetSystemMetrics(SM_CYSCREEN)

' Or you can use below

'best way is using Screen.TwipsPerPixel

MsgBox "Current Screen Resolution is " & Screen.Width / Screen.TwipsPerPixelX & " x " & Screen.Height / Screen.TwipsPerPixelY
End Sub

Category: VB General,

User Comments

There are no comments yet...Kick things off by filling out the form below.

Leave a Comment







CAPTCHA Image
Security code




Home | About Me | Products | Support | Contact Me | Knowledge base | Forums | Blog | Site map | Site Search | Subscribe | Links | News

Travel | Guest Book | All Pages | History | Site Calendar | Recipes | Ex-Rates | UK Stuff | Downloads | Telugu Stuff | Tell a Friend | Feedback

www.kiranreddys.com
Terms of Use
Site contents Copyright © 2008-2009 Kiran Reddy. All rights reserved.