Changing the screen brightness programmingly - By using the Gamma Ramp API
Some video cards allows you to programmingly modify the Gamma Ramp values. You can use this feature to change the brightness of the entire screen.
The SetDeviceGammaRamp API function receive an array of 256 RGB values. Increasing the values in this array will make your screen brighter, and decreasing these values will make your screen darker. You can also increase or decrease the intesity of the red/green/blue components. For example: Increasing the blue component in all RGB values will add more blue color to the entire display.
The following class encapsulates the calls to GetDeviceGammaRamp and SetDeviceGammaRamp, and provides the SetBrightness function for setting the brightness of the screen