Extreme Lightweight Windows Screen Brightness Sync Tool
PowerBrightnessSync is a background utility designed specifically for Windows. It monitors system Screen Brightness Changes, Display Power States, and Power Source (AC/DC) Switches, automatically synchronizing the current brightness value to all power schemes (both AC and DC settings).
It effectively solves the visual annoyance where Windows brightness suddenly "jumps" when plugging/unplugging the power cable, switching power modes, or waking the display.
Whether you are on battery or plugged in, once you adjust the brightness, this tool syncs the value to the "Plugged In" and "On Battery" settings of all existing power schemes. This ensures the brightness remains constant when you plug or unplug the charger.
Built with C++17 and native Win32 API.
- RAII & Smart Pointers: Uses
Microsoft::WRL::ComPtrandstd::unique_ptrwith custom deleters to ensure zero memory leaks and safe handle management. - COM Integration: Interacts directly with the Windows Task Scheduler via COM interfaces for reliable auto-start management.
- Tiny Footprint: Statically compiled into a single executable with no external dependencies.
Based on the WM_POWERBROADCAST event mechanism. The thread remains suspended and consumes 0% CPU until a brightness change, display toggle, or power source switch occurs.
Includes a built-in 600ms debounce timer. When you slide the brightness bar, the tool waits for the operation to settle before writing to the registry/power config. This prevents spamming the system with write operations and protects your SSD.
Runs completely silently: No window, no tray icon, no console output. It uses a hidden Message-Only Window to process system events.
Uses a named mutex (Local\PowerBrightnessSync_Mutex) to ensure only one instance is running at a time.
- OS: Windows 10 / 11 (Recommended), Windows 7 SP1+
- Privileges: Administrator rights are mandatory.
⚠️ Why Administrator? Windows restricts modifying power schemes other than the "active" one by default. To prevent brightness jumps effectively, this tool must traverse and modify the AC/DC curves of all power schemes (including hidden ones), which requires elevated privileges.
- Download the latest
PowerBrightnessSync.exefrom Releases. - Right-click and select "Run as Administrator".
- The program will perform an immediate sync and then enter background mode.
- Note: You will not see any window. Check Task Manager for
PowerBrightnessSync.exeto verify it is running.
- Note: You will not see any window. Check Task Manager for
Since there is no UI, use one of the following methods:
- Task Manager: Details tab -> End
PowerBrightnessSync.exe. - Command Line (Admin):
taskkill /f /im PowerBrightnessSync.exe
The program has built-in logic to manage Windows Task Scheduler. It creates a task with TASK_RUNLEVEL_HIGHEST to ensure it starts silently as Admin on login.
| Argument | Description |
|---|---|
--onar |
ON Auto Run: Registers the scheduled task. |
--ofar |
OFF Auto Run: Removes the scheduled task. |
Setup Example: Open CMD or PowerShell as Administrator:
:: Enable auto-start (A message box will confirm success)
PowerBrightnessSync.exe --onar
:: Disable auto-start
PowerBrightnessSync.exe --ofar-
On Windows 10 (1903+) and Windows 11, AC (plugged in) and DC (battery) brightness are typically unified within the same power plan.
Switching power sources usually does not change the brightness. -
In such cases, this program may not show noticeable effects — this is normal and does not indicate a malfunction.
-
The tool is still useful for older Windows versions, certain OEM drivers, or devices where AC/DC brightness differs.
Its main goal is to unify brightness across different power plans. -
Built using the official Windows Power Management API; behavior may vary depending on system version and hardware.
If you wish to compile the source yourself:
Requirements:
- Visual Studio 2019 or later (MSVC)
- Windows SDK
- C++17 Standard support (Required for
std::clampand others)
Compilation Command: Open the x64 Native Tools Command Prompt for VS and run:
cl /nologo /W4 /EHsc /std:c++17 /O2 /MT /GL /DNDEBUG ^
/DUNICODE /D_UNICODE /D_WIN32_WINNT=0x0601 ^
PowerBrightnessSync.cpp ^
/link /LTCG /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF ^
/MANIFEST:EMBED ^
/MANIFESTUAC:"level='requireAdministrator' uiAccess='false'" ^
/OUT:PowerBrightnessSync.exeBuild Notes:
/std:c++17: Strictly required./MT: Statically links the CRT, so the EXE runs on machines without VC++ Redistributables.#pragma comment: The source code automatically linksPowrProf,User32,Advapi32,Kernel32,Shell32,taskschd, andcomsupp, so you don't need to list.libfiles manually.
-
Initialization:
- Checks for Admin rights and Single Instance Mutex.
- Creates a hidden window (
HWND_MESSAGE). - Registers specifically for
GUID_VIDEO_BRIGHTNESSandGUID_CONSOLE_DISPLAY_STATEnotifications.
-
Event Loop:
- Upon receiving
WM_POWERBROADCAST, it resets a 600ms timer. - Once the timer expires (user stopped sliding brightness), the
PerformSync()function is called.
- Upon receiving
-
Synchronization Logic (
PerformSync):- Gets the active power scheme.
- Reads the current effective brightness.
- Iterates through every available power scheme on the system.
- Writes the current brightness value to both the AC (Plugged In) and DC (Battery) indices for the Video Subgroup.
This tool modifies system power configuration (specifically brightness curves). While the code implements safety measures (RAII, bounds checking, debounce), behavior may vary depending on specific hardware drivers or OEM power management software.
Authors are not responsible for any system anomalies caused by the use of this tool.
If you encounter bugs, please submit an Issue.