是否可以使用vc ++以编程方式在Windows Embedded标准7,Monitor:Samsung DE40A中降低“背光亮度”?使用显示器遥控器可以降低显示器背光亮度。
我已经能够使用相应的API SetMonitorBrightness
,SetMonitorContrast
等降低亮度,对比度,灰度系数和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;
我最终得到“不支持背光”,但我可以改变三星显示器遥控器的背光亮度。