473,509 Members | 2,963 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to check display settings

Hello,
is there a native (.NET class) for grabbing the current settings of the
display adaptor in the framework without going to the GetDeviceCaps API
call? They couldn't have missed this could they have?

Thanks for any direction you can give me on this.
Steve
Nov 16 '05 #1
2 5829
Hi Steve,

You can use the System.Management classes and WMI to find out this
information. I have written a sample for you below with the link to (one of)
the class in the WMI documentation.

I hope this helps.
-----------------------

//documentation lin
http://msdn.microsoft.com/library/de...controller.asp

//sample code
SelectQuery query = new SelectQuery("Win32_VideoController");
ManagementObjectSearcher searcher = new ManagementObjectSearcher(query);
foreach (ManagementBaseObject envVar in searcher.Get())
{
Console.WriteLine(envVar["VideoModeDescription"]);
Console.WriteLine(envVar["AdapterRAM"]);
}

Nov 16 '05 #2
Aright, I just knew it had to be in there and that is just about as sweet as
can be. Thank you soooo much.
For anybody else wishing more info on this, to get a list of the strings
that you pass into the envVar["some key"],
use this code inside the foreach loop below that Brian wrote

foreach (PropertyData obj In envVar.Properties)
Console.WriteLine(obj.Name);
It turns out that, for the information I was seeking, I needed to pass in
the "Win32_DesktopMonitor" string instead of "Win32_VideoController"
Awesome set of classes NTL.
Steve

"Brian Brown" <Br********@discussions.microsoft.com> wrote in message
news:30**********************************@microsof t.com...
Hi Steve,

You can use the System.Management classes and WMI to find out this
information. I have written a sample for you below with the link to (one of) the class in the WMI documentation.

I hope this helps.
-----------------------

//documentation link
http://msdn.microsoft.com/library/de...controller.asp
//sample code
SelectQuery query = new SelectQuery("Win32_VideoController");
ManagementObjectSearcher searcher = new ManagementObjectSearcher(query);
foreach (ManagementBaseObject envVar in searcher.Get())
{
Console.WriteLine(envVar["VideoModeDescription"]);
Console.WriteLine(envVar["AdapterRAM"]);
}

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
40625
by: Dan R Brown | last post by:
I have a large form that is generated dynamically in a jsp using xml / xslt. So, to break up this form into several "tabbed" sections, I break up the form using <div> tags. Each <div...
0
1730
by: yatharth | last post by:
Hi Well i tell you the situation , i am having the configsection settings like below. what i need to do is to display the sections automatically when i add new section name. after this...
2
4118
by: MarkZ2001 | last post by:
Hello: I'd like to set mouse and display settings programmatically without having to log out or restart. Is this possible by making registry settings and then having the winlogin process...
3
5910
by: Marauderz | last post by:
Hello guys, got a little question regarding the regional language settings . Anyway I got a Windows 2003 Server machine that was installed with the date format "dd/MM/yyyy" and location still...
2
3510
by: Mark | last post by:
Experts - I have a laptop running XP docked to a dual monitor setup. I find it quite annoying that even when I undock, I am still on dual monitor setting, which means some of my apps are on the...
3
9128
by: UltimateNickFury | last post by:
Hello, I am trying to display the "Printer Settings" dialogue in vb.net. I have found the code for performing this in VB6 but am wondering how this is done in vb.net. Thanks.
9
1533
by: mukeshhtrivedi | last post by:
We have MS Access 2000 Application (on Network- file server) and it workd fine as intended. However in one of our Windows XP computer (workstation) in bookd jobs module 10 digit field shows 8...
2
2706
by: remya1000 | last post by:
i'm using VB.NET. when a button is clicked the utility will display an hour glass mouse pointer, and it will begin copying the Utility settings from one computer to another computer on the...
3
1394
by: nagar | last post by:
I was thinking about using databinding to display the user settings. I'm not using the .NET 2.0 ApplicationSettings but I'm using a class that contains all the settings. I have a few questions:...
0
7234
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7136
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7344
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7412
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7069
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5652
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4730
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3216
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1570
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.