1

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

我已经能够使用相应的 API 等来降低亮度、对比度、伽玛和 RGB 值SetMonitorBrightnessSetMonitorContrast尝试使用DeviceIoControl函数 withIOCTL_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;

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

4

0 回答 0