使用vc ++降低windows Embedded标准版7中的“BACKLIGHT”亮度

时间:2016-02-03 08:17:34

标签: visual-c++ backlight windows-7-embedded

是否可以使用vc ++以编程方式在Windows Embedded标准7,Monitor:Samsung DE40A中降低“背光亮度”?使用显示器遥控器可以降低显示器背光亮度。

我已经能够使用相应的API SetMonitorBrightnessSetMonitorContrast等降低亮度,对比度,灰度系数和RGB值。 尝试将DeviceIoControl函数与IOCTL_VIDEO_QUERY_SUPPORTED_BRIGHTNESS一起使用,但函数调用不成功,它给出一个非零值,并且根据msdn函数失败。

//Get the handle
HANDLE hLCD = CreateFile("\\\\.\\LCD",       // open LCD device
                         GENERIC_READ,                  // access to the drive
                         FILE_SHARE_READ|FILE_SHARE_WRITE,// share mode
                         NULL,                          // default security attributes
                         OPEN_EXISTING,                 // disposition
                         0,                             // file attributes
                         NULL);

if (hLCD == INVALID_HANDLE_VALUE)
{
    cout << "error: Invalid Handle, unable to get LCD handle" << GetLastError() << endl;
    return 1;
}

BYTE SupportedBrightness[256];
DWORD nBytesReturned;

int nRes = DeviceIoControl(
               (HANDLE) hLCD,                           // handle to device
               IOCTL_VIDEO_QUERY_SUPPORTED_BRIGHTNESS,  // dwIoControlCode
               NULL,                                    // lpInBuffer
               0,                                       // nInBufferSize
               (LPVOID) SupportedBrightness,            // output buffer
               sizeof(SupportedBrightness),             // size of output buffer
               (LPDWORD) &nBytesReturned,               // bytes returned
               NULL                                     // OVERLAPPED
           );

if (nRes == 0)
{
    cout << "error: Backlight Not Supported" << GetLastError() << endl;
    return 2;
}

cout << "Supported levels:: ";
for (DWORD i=0; i<nBytesReturned; i++)
{
    cout << (DWORD)SupportedBrightness[i] << ", ";
}
cout << endl << endl;

我最终得到“不支持背光”,但我可以改变三星显示器遥控器的背光亮度。

0 个答案:

没有答案