首页 > 系统相关 >Windows 设置显示亮度代码【msdn】

Windows 设置显示亮度代码【msdn】

时间:2023-01-24 14:08:40浏览次数:55  
标签:cPhysicalMonitors __ msdn MONITOR Windows pPhysicalMonitors hMonitor 亮度 bSuccess


​GetPhysicalMonitorsFromHMONITOR function​

Microsoft code:

HMONITOR hMonitor = NULL;
DWORD cPhysicalMonitors;
LPPHYSICAL_MONITOR pPhysicalMonitors = NULL;

// Get the monitor handle.
hMonitor = MonitorFromWindow(hWnd, MONITOR_DEFAULTTOPRIMARY);

// Get the number of physical monitors.
BOOL bSuccess = GetNumberOfPhysicalMonitorsFromHMONITOR(
hMonitor,
&cPhysicalMonitors
);

if (bSuccess)
{
// Allocate the array of PHYSICAL_MONITOR structures.
pPhysicalMonitors = (LPPHYSICAL_MONITOR)malloc(
cPhysicalMonitors* sizeof(PHYSICAL_MONITOR));

if (pPhysicalMonitors != NULL)
{
// Get the array.
bSuccess = GetPhysicalMonitorsFromHMONITOR(
hMonitor, cPhysicalMonitors, pPhysicalMonitors);

// Use the monitor handles (not shown).

// Close the monitor handles.
bSuccess = DestroyPhysicalMonitors(
cPhysicalMonitors,
pPhysicalMonitors);

// Free the array.
free(pPhysicalMonitors);
}


you can use GetMonitorBrightness() to obtain detail max/min brightness before to set brightness.


BOOL GetMonitorBrightness( __in   HANDLE hMonitor, __out  LPDWORD pdwMinimumBrightness, __out  LPDWORD pdwCurrentBrightness, __out  LPDWORD pdwMaximumBrightness );




​SetMonitorBrightness function​


标签:cPhysicalMonitors,__,msdn,MONITOR,Windows,pPhysicalMonitors,hMonitor,亮度,bSuccess
From: https://blog.51cto.com/tody/6022262

相关文章

  • 【Windows】应用软件注册表位置
    ✨应用软件注册表位置搜索注册表编辑器或者regedit在注册表编辑器中,定位到HKEY_CURRENT_USER\Software大部分用户安装的应用软件注册表都在这个地方可以根据软件名......
  • windows2012无法自动安装VMwareTools的解决办法
    在VMware中装了台windowsserver2012,可能是系统在虚拟化环境里存在问题,无法像win7、win10那样装好后自动安装VMwareTools,没有安装VMwareTools的情况下系统就像没有安装......
  • windows11 彻底修改c盘中文用户名
                        windows11彻底修改c盘用户名由于一开始注册的时候没有注意使用了中文名导致后来再使用一些应用的时候......
  • Windows Server上部署IoTDB 集群
    本文是参考官方的IoTDB集群版(1.0.0)的安装及启动教程:​​https://iotdb.apache.org/zh/UserGuide/V1.0.x/Cluster/Cluster-Setup.html​​,在WindowsServer2019上部署集......
  • Windows10系统安装Jenkins
    注意的细节Jenkins下载选择Windows进入页面就会自动下载安装时需要测试端口是否可用选择jdk目录,要选择正确的目录只选到D:\software\jdk-11.0.17_windows-x64_bin会报错办公......
  • 【Windows】蓝牙音箱无法调节音量
    ✨蓝牙音箱无法调节音量蓝牙外设:小米小爱音箱Pro现象描述:蓝牙音箱无法通过调节系统音量调节音量大小,但是调到静音可生效。(AirPods却可以通过调节系统音量调节音量大小)......
  • windows中如何关闭 BitLocker
     华硕笔记本安装ubuntu遇到如下报错。001、 002、在检索框中输入bitlocker,然后点击打开  003、  004、  005、 ......
  • 让windows的键盘变得和mac类似
    TwoAppsSharpKeysKeyboradSteps下载两个软件:https://sharpkeys.en.softonic.com/downloadhttps://www.autohotkey.com/重新映射左Alt,左Ctrl和左Windows(......
  • MAUI中Windows的标题栏颜色怎么改
    如下图所示,MAUI中Windows下的标题栏是灰色的,如何更改颜色,找了很久,在GitHub上的issue中找到了答案,  找到/Platforms/Windows/App.xaml<maui:MauiWinUIApplication......
  • 在统信UOS上将桌面窗口输出到Windows机器上的Xming
    目前所用版本是统信UOSV20,具体版本是家庭版22.0。先尝试了一下,统信UOS自带的lightdm通过XDMCP无法正常输出到Windows机器上的Xming、VcXsrv、XManager等。看Windows端的......