Is there a way to automatically adjust screen brightness when switching to a specific program in Windows, either through built-in features or software? For example, I use a dark-themed IDE (IntelliJ IDEA) and need to raise the brightness for optimal viewing, but it makes other applications too bright.
My system is a Windows 10 Home on an ASUS ROG Strix GL702VSK laptop. I am also using AutoHotKey version 1.1.29.01 and am unsure if DDC/CI is supported on my model.
3 Answers
Introduction
Windows 10 offers a range of customization options to enhance user experience. One such customization option is adjusting screen brightness for each application. This feature allows you to manually set the brightness level for each application separately. However, it can be tedious to adjust the brightness level every time you switch between applications. In this blog post, we will explore ways to customize screen brightness for each application and automate the process.
Customizing screen brightness for each application
Windows 10 offers a built-in feature to customize screen brightness for each application. Here’s how to enable it:
- Click on the Start menu and select “Settings”.
- Click on “System” and then select “Display”.
- Scroll down to the “Brightness and color” section and click on “Windows HD Color settings”.
- Toggle on the “Use HDR” switch.
- Scroll down to the “HDR and WCG settings” section and click on “Windows HD Color settings” again.
- Toggle on the “Play HDR games and apps” switch.
- Now you can manually adjust the brightness level for each application separately.
However, this method requires you to manually adjust the brightness level every time you switch between applications. Let’s explore ways to automate this process.
Automatically adjusting screen brightness for specific programs
AutoHotKey is a free, open-source program that allows you to automate tasks in Windows 10. Here’s how to use AutoHotKey to automatically adjust screen brightness when switching to a specific program:
- Download and install AutoHotKey from the official website.
- Right-click on your desktop and select “New” and then “AutoHotKey Script”.
- Name the script and click “OK”.
- Right-click on the script and select “Edit Script”.
- Copy and paste the following code into the script:
#IfWinActive, IntelliJ IDEA
{
; Set the brightness level to 80%
SendMessage, 0x112, 0xF170, 0, % "msctls_trackbar32"
}
#IfWinActive
This code sets the brightness level to 80% when IntelliJ IDEA is active. You can modify the code to set the brightness level to any value you want.
- Save the script and double-click on it to run it.
Now, when you switch to IntelliJ IDEA, the brightness level will automatically adjust to the value specified in the script. You can modify the script to add more programs and adjust the brightness level for each program separately.
Using third-party software to adjust screen brightness
If you prefer using third-party software to adjust screen brightness, there are several options available. Here are some of the popular ones:
- f.lux: f.lux is a free software that adjusts the color temperature of your screen based on the time of day. It can also adjust the brightness level for each application separately.
- Dimmer: Dimmer is a free software that allows you to adjust the brightness level of your screen using keyboard shortcuts.
- Monitorian: Monitorian is a free software that allows you to adjust the brightness level of your monitor using a slider or keyboard shortcuts.
These software options offer more advanced features than the built-in Windows 10 feature, such as scheduling changes based on time of day or ambient light levels. They also allow you to adjust the brightness level for each application separately.
DDC/CI support
DDC/CI (Display Data Channel/Command Interface) is a protocol that allows software to communicate with the monitor to adjust settings such as brightness, contrast, and color. Not all monitors support DDC/CI, and it’s unclear if your ASUS ROG Strix GL702VSK laptop supports it. You can check if your monitor supports DDC/CI by following these steps:
- Right-click on your desktop and select “Display settings”.
- Scroll down to the “Advanced display settings” section and click on “Display adapter properties”.
- Click on the “Monitor” tab and check if the “Enable DDC/CI” option is available. If it is, select it and click “Apply”.
If the “Enable DDC/CI” option is not available, your monitor may not support it. In this case, you can still use the methods described above to adjust screen brightness for each application.
Conclusion
Customizing screen brightness for each application can greatly enhance your user experience, especially if you use applications with different brightness requirements. Windows 10 offers a built-in feature to adjust screen brightness for each application, and you can use AutoHotKey or third-party software to automate the process. If your monitor supports DDC/CI, you can use it to communicate with the monitor and adjust settings such as brightness and contrast. With these methods, you can easily customize screen brightness for each application and optimize your user experience.
It is not possible to set different screen brightness levels for individual applications in Windows 10 through built-in features. However, you can use third-party software like AutoHotKey to create a script that automatically adjusts the screen brightness when switching to a specific program.
Here is an example script that you can use with AutoHotKey to adjust the screen brightness when switching to IntelliJ IDEA:
#IfWinActive, ahk_class JetBrains.IDE.WindowImpl
SendMessage, 0x0112, 0xF170, 2, , Program Manager
Sleep, 250
SendMessage, 0x0112, 0xF170, 0, , Program Manager
#IfWinActive
This script uses the SendMessage command to send the appropriate message to the operating system to adjust the screen brightness. You will need to replace the “ahk_class” value with the appropriate value for your specific version of IntelliJ IDEA.
As your laptop is an ASUS ROG Strix GL702VSK it may not support DDC/CI, so you may need to use a third-party software.
If you are not familiar with AutoHotKey and creating scripts, you may want to seek help from someone who is more experienced with the software or look for a pre-made script that can be adapted to your needs.
To automatically adjust screen brightness when switching to a specific program in Windows, you can use the free script language AutoHotkey and the free monitor-control tool ControlMyMonitor. The following example script will dim the screen to 50% when the title of the active window contains the string “Untitled – Notepad”, and return it to 100% when the window loses focus:
SetTitleMatchMode, 2 ; set title substring match
dimmed := 0
Loop
{
sleep 500 # run loop every 500ms
IfWinActive, Untitled - Notepad
{
if (dimmed = 0)
{
dimmed = 1
Run, ControlMyMonitor.exe /SetValue Primary 10 50
}
} else {
if (dimmed = 1)
{
dimmed = 0
Run, ControlMyMonitor.exe /SetValue Primary 10 100
}
}
}
This script assumes that the script and ControlMyMonitor are in the same folder. If that’s not the case, add its path to the command.
After installing AutoHotKey, save the script as a .ahk file and double-click it to test. You can stop the script by right-clicking on the green H icon in the traybar and choosing Exit. To have it run on login, place it in the Startup group at C:\Users\USER-NAME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup.
An alternative if ControlMyMonitor does not work for your computer is ClickMonitorDDC, which uses other Windows API. For example, the following code sets the brightness to 50%:
Run, ClickMonitorDDC_7_0.exe b 50
AutoHotKey’s IfWinActive function can also be used for a filename-agnostic check, such as checking for IntelliJ IDEA project names:
IfWinActive, IntelliJ IDEA