Control of screen backlight

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
 
K

KM

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.
 
T

Thomas Johansen

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);

}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top