public bool SetBrightness(short brightness, int monitorNumber) { var brightnessWasSet = NativeCalls.SetMonitorBrightness(monitors[monitorNumber], (short)brightness); //if (brightnessWasSet) // Debug.WriteLine("Brightness set to " + (short)brightness); int lastWin32Error = Marshal.GetLastWin32Error(); return(brightnessWasSet); }
public bool SetBrightness(short brightness, int monitorNumber) { var brightnessWasSet = NativeCalls.SetMonitorBrightness(pPhysicalMonitorArray[monitorNumber].hPhysicalMonitor, (short)brightness); if (brightnessWasSet) { Debug.WriteLine("Brightness set to " + (short)brightness); } int lastWin32Error = Marshal.GetLastWin32Error(); return(brightnessWasSet); }