GetSystemMetrics32(n) Question

G

Guest

I have found many articles on the web about the use of GetSystemMetrics(n)
to determine the screen resolution by using n=0 and n=1. However, running
the code:
Declare Function GetSystemMetrics32 Lib "user32" _
Alias "GetSystemMetrics" (ByVal nIndex As Long) As Long

Sub x()
Dim i As Long

For i = 1 To 300
Range("A" & i) = i - 1
Range("B" & i) = GetSystemMetrics32(i - 1)
Next i
End Sub

Seems to be giving meaningful values for n=0-84. All n>84 return 0.

I found that n=80 gives the number of monitors.

Is there a list of all meaningful values of n? (I haven't been able to
find one.)

Many thanks.
 
G

Guest

Thanks for the reply and the list.

From experimentation, there must be many more valid arguments. For
example, as I mentioned, n=80 returns the number of monitors and that value
is not on Microsoft's list in kb/210603. I tried adding and deleting
monitors from my multiple monitor system, and n=80 always gave the current
number of monitors.

On my system, 66 values of n returned a non-zero value. Some of the zero
returns also had meaning according to kb/210603.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Find #N/A in column D 2
Marco is not working 1
Screen Resolution 2
Need help modifying code 0
Junp start my Select Case Macro 12
Excel Auto Zoom Module 7
Excel Programming 3
Remove Identical words 0

Top