VB and VBA Users Source Code: Determine Screen Dimensions
[
Home
|
Contents
|
Search
|
Reply
| Previous | Next ]
VB/VBA Source Code
Determine Screen Dimensions
By:
Andrew Baker
Email (spam proof):
Email the originator of this post
Date:
Thursday, September 28, 2000
Hits:
620
Category:
Office
Article:
To determine the screen dimensions use the following simple functions: '-----------------------------System Metrics API------------------------------ Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long 'Purpose : Determine the screen width 'Inputs : N/A 'Outputs : Screen width in pixels 'Author : Andrewb 'Date : 29/08/2000 'Notes : 'Revisions : Function ScreenWidth() As Long Const SM_CXSCREEN = 0 ScreenWidth = GetSystemMetrics(SM_CXSCREEN) End Function 'Purpose : Determine the screen height 'Inputs : N/A 'Outputs : Screen height in pixels 'Author : Andrewb 'Date : 29/08/2000 'Notes : 'Revisions : Function ScreenHeight() As Long Const SM_CYSCREEN = 1 ScreenHeight = GetSystemMetrics(SM_CYSCREEN) End Function
Terms and Conditions
Support this site
Download a trial version of the Excel Workbook Rebuilder