Control of screen backlight

  • Thread starter Thread starter Reto Bucher
  • Start date Start date
R

Reto Bucher

I'm looking for a solution to control the backlight of an attached display.
Doas anybody know how this can be done (switch light on/off, adjust
brightness).
How does windows handles this?


Best Regards
Reto Bucher
 
Reto,

I guess the backlight feature on XP (therefore on XPe) is display (LCD) and
manufacture software (driver, custom agent app or control panel applet)
specific.
I don't think there is a common backlight setting in XP.
If you display and its driver support the feature, from your app you can
query display brightness by
DeviceIoControl(...,IOCTL_VIDEO_QUERY_SUPPORTED_BRIGHTNESS,...)
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/power/base
/ioctl_video_query_supported_brightness.asp) or set it by
DeviceIoControl(...,IOCTL_VIDEO_SET_DISPLAY_BRIGHTNESS,...)
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/power/base
/ioctl_video_set_display_brightness.asp).
Check Win DDK documentation on the subject.
 
Hi

Take a look at SetDeviceGammaRamp(..) function. Is part of the ICM
functions. I have used this to control brightness of my device.

It does'n actually control the backlight converter it self, but it just
moves the gamma ramp, so you get the same effect. But the hardware has to
support it (All new does).

Sample:

// Struct for RGP values
typedef struct
{
WORD gRed[256], gGreen[256], gBlue[256];
} GammaCurve;

.......
// Fill out the needed gama ramp here..
.......

if(!SetDeviceGammaRamp(::GetDC(NULL), &newCurve))
{
int error = GetLastError();
TRACE("Leading zeore's = % u Error= %u \r\n", nLeadingZeros, error);
}
else
{
TRACE("Leading zeore's = % u \r\n", nLeadingZeros);

}
 
Back
Top