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);
        }
Beispiel #2
0
        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);
        }