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 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.
0
NoSpam
4/14/2010 4:15:09 PM
excel.programming 6508 articles. 2 followers. Follow

3 Replies
1530 Views

Similar Articles

[PageSpeed] 9

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)



<NoSpam@aol.com> wrote in message 
news:1hpbs594d6mtagctqsra5g7f6th919dvgv@4ax.com...
> 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. 

0
Rick
4/14/2010 4:39:30 PM
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"
<rick.newsNO.SPAM@NO.SPAMverizon.net> 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

0
NoSpam
4/14/2010 5:29:49 PM
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)



<NoSpam@aol.com> wrote in message 
news:i8sbs5t0l6riadtqnpe0cqbfuokoc72ncs@4ax.com...
> 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"
> <rick.newsNO.SPAM@NO.SPAMverizon.net> 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
> 
0
Rick
4/14/2010 5:41:43 PM
Reply:

Similar Artilces:

sample questions to be inserted for the questionnaire/ interviews
I am a Masters degree (business IT) student who is doing a research study on how MS project server 2007 could be utilized as a framework for managing IT projects for any organization to achieve its business value. For this research project I will be conducting several interviews and collecting some information through questionnaires from the organization concerned with. I am just looking for some sample questions to be inserted for the questionnaire and also to be used in business analysis interviews while doing the detailed business analysis with different levels of staff in...

Question about dialog.
I have an application which use several dialogs (CDialog1, CDialog2,...). CDialog1 is popped up by a fuction call as following (Works well): func(...hWnd...)//hWnd is the main windows' handle { CWnd wndParent; if (wndParent.Attach( hWnd ) ) { CDialog1 dlg( &wndParent ); dlg.DoModal(); wndParent.Detach(); } } Now, in CDialog1, I want to start another dialog by using: CDialog2 dlg; dlg.DoModal(); //failed I got run time error. Why? "kathy" <yqin_99@yahoo.com> wrote in message news:1129328476.748520.213520@g43g2000cwa.googlegroups.com... &...

Mailbox move question
All, I initiated the movement of several large mailboxes 1 gig plus last night. It did not complete by this morning, so I canceled the move. They canceled just fine, and people have access to their email, but the server is SLOW. It isn't a processor thing either, it is strictly IO from what I can tell. Anyone have similar experience? Any ideas? -Pair On Fri, 28 Jul 2006 13:12:22 -0700, "TwistedPair" <twistedpair@mail.com> wrote: >All, >I initiated the movement of several large mailboxes 1 gig plus last night. >It did not complete by this morning, so I ...

Another relationship question
I've been working on this for some time and have yet to get what I need; I'm working on a db to keep track of art shows I apply to and attend, there are three tables: Art Shows - contains ID(auto number), name, address, Contact , etc. Application Data - contains ID(auto number), application due date, fees, year applied, and accepted/declined. Show Results - contains ID(auto number), gross sales, expenses, net sales One show may have many application data entries(one for each year applied to as well as many show results for the same reason. The ID fields are set as...

N/a Error In Excel 2003
I work in an office with multiple different excel versions, most of th time things run fairly smooth. I'm running across a problem with worksheet in excel 2002. It is being sent to a person with excel 200 on there pc and all of the figures are showing up as NA. Please advis if there is a solution to this problem -- Message posted from http://www.ExcelForum.com What is the formula producing this message? Is it from the analysis toolpak addin, and do they have it installed on their PC? -- Regards Ken....................... Microsoft MVP - Excel Sys Spec ...

NewsGroups Rules Question
There are a couple of Usenet groups that I find useful (like this one, obviously). In one of the groups there are a number of 'Trolls' that I find irritating. I typically generate a 'rule' for the irritating poster(s) that says (in this case) Where the From line contains 'nobody@dizum.com' then delete it This typically works but for this particular person he/she keeps showing. I browsed through all my 'Newsgroup Rules' and the rule that says delete this case shows up four times. But he/she is (as far as I can tell) is never deleted from my v...

Question about CEdit and ENTER-TAB keys
I've a CEdit control inside a CDialog, and I want to perform a checkup in the value of the CEdit, but ONLY when the user hits ENTER or TAB. I guess that the TAB can be done using the ON_EN_KILLFOCUS(IDC_EDIT1, OnKillfocusEdit1) map. However, I have not been able to find an event for the Enter case. ON_EN_CHANGE(IDC_EDIT1,OnChangeEdit1) doesn't work for me, since I'd like to perform the check ONLY after an Enter, not anytime the text in the control changes. I also tried overriding OnKeyDown in the CEdit class, but the message is not triggered for Enter key. So, my question is: Is...

extremely basic question about paragraph indenting
This is a terribly basic question but I can't find the answer in Word Help. How do I indent all the paragraphs of a Word document, not just one para... Michael Well, if you want *all* the paragraphs indented, then maybe you actually want to change the margins? So, for instance, that there is a 2-inch left margin on every page instead of a 1-in margin? To do that, go to Format | Document | Margins (assuming you are using MacWord). (This will partially affect the headers). Otherwise, you can indent more than one paragraph at a time by selecting more than one paragraph at a time, and th...

Quick questions on setup of 2003?
Can you install Active Directory Connector after Domain prep and Forest prep have been run? If you have run the Domain Prep and Forest prep for 2000, do need to run it for 2003? "LT" <anonymous@discussions.microsoft.com> wrote: >Can you install Active Directory Connector after Domain >prep and Forest prep have been run? Yes. >If you have run the Domain Prep and Forest prep for 2000, >do need to run it for 2003? Yes. -- Rich Matheisen MCSE+I, Exchange MVP MS Exchange FAQ at http://www.swinc.com/resource/exch_faq.htm ...

Exchange 2003 Recipient Policy Question
I would like to use a recipient policy to implement a company-wide email retention policy. The policy is somewhat lax, however - we're only applying the policy to the Inbox and Sent Items proper, and NOT to user-created folders beneath those two default folders. I cannot tell from the recipient policy setup template whether subfolders will be affected, allthough I *think* they will. Can anyone confirm? If the recipient policy will automatically apply to subfolders, is there any way to modify it to stop that behavior? - Patrick W. ...

Outlook Tasks Question
I have user's who e-mail other users of tasks needing to be completed. When an e-mail is received no option in the incoming e-mail allows them to Accept or Decline the task. Does anyone know how to enable this option? Thanks. To send a Task request the user that you are sending to has to be configured in Rich Text, double click the resolved email address in the To field and set to Rich text, of course the recipient needs to use Outlook as well :) "Scott" <scottcukier@hotmail.com> wrote in message news:08b401c3faf3$33284560$a001280a@phx.gbl... > I have user's w...

Question about x.y.z order
My god, I have some excel file, the data sheets have so many columns, and I need order like following, 1.1.1 1.1.1.2 1.1.2.1 1.1.3 1.1.4.2.3 1.2.5 1.10.6 1.11.1 How ever, using the excel order function, it looks like 1.1.1 1.1.1.2 1.1.2.1 1.1.3 1.1.4.2.3 1.10.6 1.11.1 1.2.5 The 1.2.5 shell before 1.10.6, how can I do it? Thanks for help. If you entered the values as: 001.001.001.002 (as many leading 0's as you need for the biggest number) Then your sort would work fine. An alternative is to insert as many empty columns to the right and then using data|text to columns|delimited by ...

XML inheritance, question about xml configuration. Thanks
For a long time, I am looking for a way to setup a standard way XML inheritance for my project. I am sure the way I call it is not right, but I think what I need is reasonable. Basically, I want something work like web.config, my project have many levels, on each level, user can put some settings into XML, what I need is a way to give user the ability to change all settings when they want, in the mean time, inherit settings if they are not set in current level, for example, one level 1, I could have setting like <settings> <section id="1"> <pagesize>16</pag...

free dot interview questions information
..NET database dev questions http://freedownloadablebooks.blogspot.com/2008/03/net-database-dev-questions.html Some general quickies http://freedownloadablebooks.blogspot.com/2008/03/some-general-quickies.html ..NET WebDev interview questions - Part 1 http://freedownloadablebooks.blogspot.com/2008/03/net-webdev-interview-questions-part-1.html ..NET WebDev interview questions - Part 3 http://freedownloadablebooks.blogspot.com/2008/03/net-webdev-interview-questions-part-3.html Electronic engineer interview questions http://freedownloadablebooks.blogspot.com/2008/03/electronic-engineer-interview-...

Double-Click question
I have a function that is called by both WM_LBUTTONDOWN and WM_LBUTTONDBLCLK messages. However the double-click behavior seems to depend on the state of the system (what exactly I don't know). Can anyone speculate what might cause this? Could it be the time limit between clicks or could the state of the system reduce this time limit? (BTW, what is the limit normally set at?) Thanks, E-Jo Define "state of the system". The double-click behavior is independent of any other consideration of system state unless your code is dependent on the system state. The only thing that th...

Pivot table question: How to display total and percent for data simultaneouly
I'd like to make a pivot chart that displays the same data both as a total and as a percentage at the same time: Example: Consider the following source data: Name Category Value a c1 10 a c2 20 b c1 5 b c2 30 It is easy enough to make a pivot table displaying: Sum of Value Category Name c1 c2 Grand Total a 10 20 30 b 5 30 35 Grand Total 15 50 65 It is also easy to display the percentages of the grand total for each entry. I'd like to display both simultaneously. Something like Name c...

RMS 2.0 Headquartner Client Licence Question vs old Dongle on HQ R
Hello, We are moving from RMS 1.2 to RMS 2.0, I have notice the RMS 2.0 the license is registers at the store level vs. the dongle being use at the HQ RMS Server level for all the store. I don't see any registeration process for the RMS HQ Server since the HQ Client has the individual license now. Is this correct? Ed you should have a separate SO license for each lane that runs POS, and an HQ license for each store for the HQClient to upload to HQ. "Ed" wrote: > Hello, > > We are moving from RMS 1.2 to RMS 2.0, I have notice the RMS 2.0 the > license i...

.pst question
Outlook/Exchange novice here.... I have a user that has archived files to different areas on his laptop. He wants them all to appear in his folder list under Archive Folders. If I copy and paste them into docs and settings\%username%\local settings\application data\microsoft\outlook do i need to rename the files so as not to overwrite the one archived file that is in there? In other words, what is the proper procedure to restore these archived files that are not where Outlook 2k sees them so that they can be viewed in his Archive Folders list? Thank you Hey, What I would do is put...

Sort Question
Can you sort a cell by color? What version of excel are you using? dwake wrote: > > Can you sort a cell by color? -- Dave Peterson EXCEL 2007 Data / Sort & Filter group / Sort / Sort window should launch / in the Sort On field select Cell Color If my comments have helped please hit Yes. Thanks. "dwake" wrote: > Can you sort a cell by color? Not naturally, but see here for workaround: http://www.ozgrid.com/VBA/Sort.htm -- Best Regards, Luke M "dwake" <dwake@discussions.microsoft.com> wrote in message ne...

Question for Windows Speech Recognition guru
Need advice from Vista Speech Recognition guru. (formal name WSR, for Windows Speech Recognition) The "Analyze Written Documents" feature of WSR appears to be broken. I try to keep up-to-date on three different SR apps, which is not easy, because of the differences. The three SR apps are: 1) Dragon Pro 2) WSR (Vista Speech Recognition) 3) MacSpeech Dictate ....using most recent versions of above 3 apps Without going into the reason _why_ , I would like to be able to speak the following, and have it come out exactly as shown in the two examples below...

User Form Question
Hi, I have created a user form for entering names and addresses. I want the content of the form to go into the next row in a workbook when a button is pressed. I can get it to go to set cells but not the next free cells ? Any advice ? David Can't see your code but have a look at Offset method or defining LastRow in a range. Gord Dibben MS Excel MVP On Mon, 26 Jan 2009 19:51:19 +0000, David <davidjcleland@hotmail.com> wrote: >Hi, > >I have created a user form for entering names and addresses. I want the >content of the form to go into the next row in a workbo...

stupidly easy question
i am having a problem creating a graph with the year on the (x) asix an a value on the (y) axis. when i try and make the graph, the wizar always puts the year as a value, not as the (x) axis... how can i make the year as the(x) axis?! thanks in advance, confused -- leppel Depending on how you've constructed your data in the cells Try to select :" Rows " or " Columns " after you've defined the Source data > Data Range > Series In: Rows Columns "lep...

DLL Question #7
Hi guys, I wanted to create a DLL which uses MFC CRecordset. I do the following steps 1) Create a new class (Class type -->MFC Class Base Class --> CRecordset) 2) it the .h file add the following code #define DLLEXPORT _declspec(dllexport) class DLLEXPORT xx : public CRecordset { ........................... ........................... } Is that the correct way to build a dll with CRecordset "Newbie & Noobie" <NewbieNoobie@discussions.microsoft.com> wrote in message news:09DC429F-8C55-47A5-8A9A-CBBD98AA9051@microsoft.com... > #define DLLEXPORT...

Multi page worksheet question
Hi guys i have a roster that is on a single worksheet. What i want to do is when I change a name into a particular shift it then takes that shift and copies the shift onto another worksheet. So when its done each employee will have a worksheet with just his shifts on it, there are only 5 employee's atm, so instead of them having to go through every day to see what each day has they can just click on their own name and get a roster that has the week setup for them. Does this make sense? if not I can post the roster to show you what it is I want to accomplish. many thanks -- Codger ...

Active document opened in IE questions
Hi all I have created an active document application. When I typed a file name in IE's location bar in WinMe, IE started my application to display the file I want to know, by what mean, IE send message to my application to open the file? If I want to get the message sent to my application by IE, how t do it Second, when typed another file's name in IE's location bar, IE first use my application to open the file , then it told my application to close the first file, errors ocurs , when my application get the close message, the second file is also closed, what can I do many th...