Click here to Skip to main content
16,006,535 members
Home / Discussions / C#
   

C#

 
JokeRe: Using an Array inside a Class Pin
PIEBALDconsult29-Aug-12 11:30
mvePIEBALDconsult29-Aug-12 11:30 
GeneralRe: Using an Array inside a Class Pin
Wes Aday29-Aug-12 11:35
professionalWes Aday29-Aug-12 11:35 
AnswerRe: Using an Array inside a Class Pin
PIEBALDconsult29-Aug-12 11:33
mvePIEBALDconsult29-Aug-12 11:33 
AnswerRe: Using an Array inside a Class Pin
Kenneth Haugland29-Aug-12 11:51
mvaKenneth Haugland29-Aug-12 11:51 
AnswerRe: Using an Array inside a Class Pin
Bernhard Hiller29-Aug-12 20:49
Bernhard Hiller29-Aug-12 20:49 
AnswerRe: Using an Array inside a Class Pin
Pete O'Hanlon29-Aug-12 22:47
mvePete O'Hanlon29-Aug-12 22:47 
AnswerRe: Using an Array inside a Class Pin
harold aptroot30-Aug-12 2:39
harold aptroot30-Aug-12 2:39 
QuestionHow to get the properties of more than one display monitor attached to my computer Pin
Nathaniel Lim29-Aug-12 10:09
Nathaniel Lim29-Aug-12 10:09 
Hello everyone,

I have a project that requires me to gather inventory data for my computer. I am having problems trying to get the properties of the monitors attached to my computer.

I have one computer that can potentially use a max of 4 monitors, wherein I have a primary monitor and 3 other potential monitors which act as extension screens when I move my mouse to them ( depending on whether they are connected or not ).

I need to grab the following information from each monitor :

DeviceId,
Name,
Horizontal and Vertical resolution,
Whether or not the monitor is the primary one ( a true or false value will suffice ).

I tried using the WMI, Win32_DesktopMonitor class but it is only giving me ONE monitor's results ( the primary monitor ).

I then tried using the Win32_PnPEntity class.
This works, and gives me the number of monitors attached to my computer, but it only gives me Name and DeviceId ( no horizontal and vertical resolution information in this class ).

I forgot to add and I apologize for this... this application I am building will eventually be ran as a Windows Service application.

I discovered this during my development ---- when I tried the Screen class (using the System.Windows.Forms.Screen), the result is erratic.

If I ran the program as a pure console application, it works and gives me the right number of monitors attached to my computer, when I ran the same program as a windows service, it does not. It only gives me ONE ( the primary monitor ).

Does anyone know of a Class provided by .NET 4 that will help me gather the information I need?

I am using .NET Framework 4 and building my application as a Windows Service Application.

For everyone's information, I am using the following environment:

1) .NET 4
2) Visual Studio 2010
3) C# programming language
4) Windows service Application

Any suggestions and advise will be highly appreciated.

modified 30-Aug-12 8:21am.

AnswerRe: How to get the properties of more than one display monitor attached to my computer Pin
Dave Kreskowiak29-Aug-12 13:04
mveDave Kreskowiak29-Aug-12 13:04 
QuestionRecruitment Pin
boys-esan29-Aug-12 10:09
boys-esan29-Aug-12 10:09 
QuestionGet Error when connect to DB2 on server Pin
kathytran29-Aug-12 7:07
kathytran29-Aug-12 7:07 
AnswerRe: Get Error when connect to DB2 on server Pin
Dave Kreskowiak29-Aug-12 12:58
mveDave Kreskowiak29-Aug-12 12:58 
QuestiontextBoxes Calculation issue Pin
haroon198029-Aug-12 6:30
haroon198029-Aug-12 6:30 
AnswerRe: textBoxes Calculation issue Pin
Wes Aday29-Aug-12 6:46
professionalWes Aday29-Aug-12 6:46 
GeneralRe: textBoxes Calculation issue Pin
haroon198029-Aug-12 6:51
haroon198029-Aug-12 6:51 
GeneralRe: textBoxes Calculation issue Pin
Wes Aday29-Aug-12 6:54
professionalWes Aday29-Aug-12 6:54 
GeneralRe: textBoxes Calculation issue Pin
haroon198029-Aug-12 10:58
haroon198029-Aug-12 10:58 
GeneralRe: textBoxes Calculation issue Pin
Dave Kreskowiak29-Aug-12 12:52
mveDave Kreskowiak29-Aug-12 12:52 
GeneralRe: textBoxes Calculation issue Pin
haroon198029-Aug-12 23:49
haroon198029-Aug-12 23:49 
GeneralRe: textBoxes Calculation issue Pin
Dave Kreskowiak30-Aug-12 1:41
mveDave Kreskowiak30-Aug-12 1:41 
QuestionBlank lines in a rich text box from a Serial Device, am I getting rid of them correctly..... Pin
glennPattonWork329-Aug-12 4:21
professionalglennPattonWork329-Aug-12 4:21 
AnswerRe: Blank lines in a rich text box from a Serial Device, am I getting rid of them correctly..... Pin
Pete O'Hanlon29-Aug-12 4:30
mvePete O'Hanlon29-Aug-12 4:30 
GeneralRe: Blank lines in a rich text box from a Serial Device, am I getting rid of them correctly..... Pin
glennPattonWork329-Aug-12 5:00
professionalglennPattonWork329-Aug-12 5:00 
GeneralRe: Blank lines in a rich text box from a Serial Device, am I getting rid of them correctly..... Pin
Pete O'Hanlon29-Aug-12 5:13
mvePete O'Hanlon29-Aug-12 5:13 
GeneralRe: Blank lines in a rich text box from a Serial Device, am I getting rid of them correctly..... Pin
glennPattonWork329-Aug-12 5:37
professionalglennPattonWork329-Aug-12 5:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.