Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 142
Default GetSystemMetrics32(n) Question

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 n84 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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default GetSystemMetrics32(n) Question

Here is a link to a list of arguments (there are only about 38 of them) and
what they mean...

http://support.microsoft.com/kb/210603

--
Rick (MVP - Excel)



wrote in message
...
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 n84 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.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 142
Default GetSystemMetrics32(n) Question

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.

On Wed, 14 Apr 2010 12:39:30 -0400, "Rick Rothstein"
wrote:

Here is a link to a list of arguments (there are only about 38 of them) and
what they mean...

http://support.microsoft.com/kb/210603


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default GetSystemMetrics32(n) Question

A little more searching revealed this link which shows more parameter
values, but without an explanation (only somewhat cryptic parameter names as
a hint)...

http://wiki.tcl.tk/15401

--
Rick (MVP - Excel)



wrote in message
...
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.

On Wed, 14 Apr 2010 12:39:30 -0400, "Rick Rothstein"
wrote:

Here is a link to a list of arguments (there are only about 38 of them)
and
what they mean...

http://support.microsoft.com/kb/210603


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good davegb Excel Programming 1 May 6th 05 06:35 PM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you [email protected] Excel Programming 0 April 27th 05 07:46 PM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you [email protected] Excel Programming 23 April 23rd 05 09:26 PM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you [email protected] Excel Programming 0 April 22nd 05 03:30 PM
GetSystemMetrics32() [Screen Size and UserForms - pt 2] Jason Gatsby Excel Programming 0 August 4th 03 06:54 PM


All times are GMT +1. The time now is 03:19 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"