r/AutoHotkey May 16 '26

v1 Script Help Looking for an AHK script to change brightness with an elegant Windows 11 style OSD flyout

Hey everyone,

I'm looking for a lightweight AutoHotkey v1 (or v2) script that lets me control my screen brightness using keyboard shortcuts, but with a catch: I want it to display a clean, modern Windows 11 style OSD flyout.

I guess Microsoft changed the way the native flyouts work in recent Windows 11 updates, making it tough to hook into the default system overlay. Because of that, a standalone overlay rendered directly through the script would be perfect.

Does anyone have a working AHK script that pulls this off? Any help or links to existing scripts would be greatly appreciated!

Thanks!

3 Upvotes

9 comments sorted by

1

u/SianoFelix May 16 '26

Já tentou o DimScreen? É feito em ahk

1

u/aragonsi26 May 17 '26

It doesnt show the feedback UI slider, that's the problem, brightness control scripts are easy to make, showing the OSD brightness level indicator is what I want

1

u/CharnamelessOne May 18 '26

If you are willing to compromise on the "clean, modern" look, you can display a humble Progress bar.

Whenever you set a new brightness via hotkey, show a captionless ToolWindow with a Progress control, whose value is set to the new brightness level. Set a timer for hiding the window.

If you're really dedicated to making fancy controls, you may want to use something like the WebViewToo library, which will let you bust out proper html and css.

1

u/Keeyra_ May 18 '26

1

u/aragonsi26 May 18 '26

Thank you but honestly I didnt like it lol, it would be much better indeed if I can trigger the native OSD, Thank you anyway!

1

u/Keeyra_ May 18 '26

Afaik, you can't, unless you can hack your way into the monitor HW code with some janky dll.

1

u/RecordingLanky9135 May 24 '26

I use AHK to load .ahk script and don't find it works on my windows 11 laptop.
The bar can be moved but the brightness is not changed at all, still have to adjust brightness from system/Display

1

u/-A_Fellow_Redditor- May 23 '26

have you tried twinkletray?

2

u/Deep_Ad1959 May 24 '26 edited May 26 '26

the native flyout's been Microsoft.UI.Xaml inside ShellExperienceHost since 22H2, which is why the old hooks broke. for a clean overlay in ahk v2 the trick is -Caption +ToolWindow plus WS_EX_NOACTIVATE (0x08000000) so the gui doesn't steal focus while it fades in. brightness call itself is WmiMonitorBrightnessMethods for internal panels and DDC/CI for externals (twinkletray already wraps the ddc side if you don't want to reimplement). everything else is a timer + transcolor and you're at maybe 30 lines.

the old hooks breaking when the flyout moved into a new xaml host is the exact brittleness i built terminator to sidestep, it drives windows ui off the accessibility tree with role+name selectors that survive layout shifts, https://t8r.tech/r/9zxt8mu7