草庐IT

pPhysicalMonitors

全部标签

c++ - 在 Windows 中执行 SetMonitorBrightness 函数时出现无效的监视器句柄错误 - C++

我正在Windows中编写程序,我想获得计算机显示器的亮度。我正在使用WindowsGetMonitorBrightness函数,但遇到了一些问题。到目前为止,这是我的代码:DWORDdw;HMONITORhMonitor=NULL;DWORDcPhysicalMonitors;LPPHYSICAL_MONITORpPhysicalMonitors=NULL;LPDWORDpdwMinimumBrightness=NULL;LPDWORDpdwCurrentBrightness=NULL;LPDWORDpdwMaximumBrightness=NULL;HWNDhwnd=FindWin