October 2nd, 2012, 02:12 AM
Put Individual Monitors into Power Down State?
Hello, I am working in C#, and I have been working on a small project I thought might come in handy with those that have many monitors, and system developers.
Problem I have run into is, I cannot for the life of me figure out how to turn off only ONE monitor I specify. So far I have come across many articles that describe using the SendMessage function, and even using something similar to this:
That does absolutely nothing atm, as I'm still researching the subject. I have successfully turned off ALL monitors using the SendMessage command, but wish to target each monitor selectively.
WinApi.DisplaySetting_Results result = 0;
//manual gather - NewPrimary name ----------------------------------------------------
WinApi.DISPLAY_DEVICE ddOne = new WinApi.DISPLAY_DEVICE();
ddOne.cb = Marshal.SizeOf(ddOne);
deviceID = mnum-1;
WinApi.User_32.EnumDisplayDevices(null, deviceID, ref ddOne, 0);
string MonitorName = ddOne.DeviceName;
WinApi.DEVMODE ndm4 = NewDevMode();
ndm4.dmFields = WinApi.DEVMODE_Flags.DM_DISPLAYFLAGS;
ndm4.dmDisplayFixedOutput = 0;
result = (WinApi.DisplaySetting_Results)WinApi.User_32.ChangeDisplaySettingsEx(MonitorName, ref ndm4, (IntPtr)null, (int)WinApi.DeviceFlags.CDS_UPDATEREGISTRY, IntPtr.Zero);
So far I have been able to collect this information via my program to utilize. If anyone knows of a way to send DDC/CI commands or target the monitors by some of this information let me know.
Screenshot below....not sure why it's not showing up in the post via IMG tags.
Thank you for any information