@Thandor

Как достать текущую яркость экрана через winapi?

Код:
HMONITOR hMonitor;
DWORD number=0;
DWORD min=1, max=2, cur=3;
PHYSICAL_MONITOR PhMonitor;
HANDLE hPhMonitor;
BOOL i;
const HWND hDesktop = GetDesktopWindow();
hMonitor = MonitorFromWindow(hDesktop, MONITOR_DEFAULTTOPRIMARY);
GetNumberOfPhysicalMonitorsFromHMONITOR(hMonitor, &number);
GetPhysicalMonitorsFromHMONITOR(hMonitor, 1, &PhMonitor);
hPhMonitor = PhMonitor.hPhysicalMonitor;
GetMonitorCapabilities(hPhMonitor, &min, &cur);
GetMonitorBrightness(hPhMonitor,&min,&cur,&max);
DestroyPhysicalMonitors(number, &PhMonitor);

GetMonitorBrightness выдает ERROR_GRAPHICS_I2C_ERROR_TRANSMITTING_DATA, у меня win 8.1
У знакомого на win 10 все работает.
Есть какой-либо другой способ или возможность исправить этот?
  • Вопрос задан
  • 671 просмотр
Пригласить эксперта
Ответы на вопрос 1
Spetros
@Spetros
IT-шник
Remarks
If this function is supported, the GetMonitorCapabilities function returns the MC_CAPS_BRIGHTNESS flag.
This function takes about 40 milliseconds to return.

https://msdn.microsoft.com/ru-ru/library/windows/d...
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы