輝度調整


Trying to open display device handle to change brightness on Windows XP using C++
https://stackoverflow.com/questions/11874615/trying-to-open-display-device-handle-to-change-brightness-on-windows-xp-using-c?noredirect=1&lq=1

ディスプレイによってCreateFile(_T("\\\\.\\LCD")
APIをサポートしている/いないが存在する

[Windows 7]
::CreateFile(_T("\\\\.\\LCD"),
ではハンドルの生成に失敗するが
デスクトップPC用ディスプレイが関係している?
(ノートPCでは成功)

[Windows 7/10]
SetMonitorBrightness()
GetLastError():0だが、戻り値がFALSE

---------------------

Setting brightness on Windows 10 using C++ WinAPI
https://stackoverflow.com/questions/39262619/setting-brightness-on-windows-10-using-c-winapi

輝度調整時のDeviceIoControlの利用方法について記載
まずはディスプレイのハンドラを取得できる方法を探す

Set/GetMonitorBrightness()利用前に、
GetMonitorCapabilitiesでモニタが対応しているかチェックする必要がある
対象ディスプレイは非対応の模様

---------------------

GetMonitorCapabilities function
https://msdn.microsoft.com/ja-jp/library/windows/desktop/dd692940(v=vs.85).aspx
MC_CAPS_BRIGHTNESS
The monitor supports the GetMonitorBrightness and SetMonitorBrightness functions.

---------------------

miyuriの日記: ソフトウェアでディスプレイの設定を行えない
https://srad.jp/~miyuri/journal/531328/

日本語訳としては同じエラーか?

---------------------

How to use GetMonitorCapabilities and GetMonitorBrightness functions
https://stackoverflow.com/questions/34091968/how-to-use-getmonitorcapabilities-and-getmonitorbrightness-functions

開発PCだとこのやり方で輝度設定値が取得できた

---------------------

I2C error when using the Windows Monitor Configuration Functions
https://stackoverflow.com/questions/30969702/i2c-error-when-using-the-windows-monitor-configuration-functions

DDC/CIの設定を見直してみる

---------------------

Error 6: Invalid Handle DeviceIoControl()
https://stackoverflow.com/questions/36130052/error-6-invalid-handle-deviceiocontrol

SetMonitorBrightness()が動作しないディスプレイのため、
IOCTL_VIDEO_SET_DISPLAY_BRIGHTNESSを試した

EnumMonitorsから取得したモニターデバイス名、または「DISPLAY1」のようなエイリアスを使用
モニターとのI2C通信が機能しない場合、IOCTLは失敗する可能性が高い

1.EnumMonitorsでモニタ名取得
2.DeviceIoControlでDeviceIoControl(IOCTL_VIDEO_QUERY_SUPPORTED_BRIGHTNESS)呼び出し

---------------------

Cannot handle on LCD by createfile on win8 OS
https://social.msdn.microsoft.com/Forums/windows/en-US/3dfad073-c936-4e7d-8850-4c288e437e2d/cannot-handle-on-lcd-by-createfile-on-win8-os?forum=vcgeneral

画面の輝度調整はOSとH/Wドライバがサポートしていなければならない
CreateFileの失敗はH/Wドライバがサポートしていない可能性が高い

---------------------

EnumDisplayDevices function not working for me
https://stackoverflow.com/questions/9524309/enumdisplaydevices-function-not-working-for-me

バイス名(_T("\\\\.\\DISPLAY1", T("\\.\DISPLAY1\Monitor0")は取得可能