Page 1 of 1

Detect screen brightness changes in Windows 10

Posted: 06 Nov 2018, 04:52
by lblb
There is a variety of scripts and strategies that can be used to change the brightness on a laptop. For example, the following (which include some repeated codes) all work on my Windows 10 laptop:

https://autohotkey.com/boards/viewtopic.php?t=36170
https://autohotkey.com/boards/viewtopic ... 1&p=126135
https://autohotkey.com/boards/viewtopic.php?f=6&t=7854
https://autohotkey.com/boards/viewtopic.php?t=39580

My question is: Is there a way to detect brightness changes, to monitor and report the new value (maybe by monitoring Windows messages or WinHook) when the screen brightness is changed using the Windows 10 brightness button in the Action Center (i.e., the button that allows cycling through brightness by 25% increments)?

Thanks much in advance!

Re: Detect screen brightness changes in Windows 10  Topic is solved

Posted: 06 Nov 2018, 15:40
by TLM
This modified version of my WMI eventhandler works for me:
The added bonus is you can return property values for things like brightness e.g.tooltip % eventObj.Brightness

Even better, wrapped to class

Re: Detect screen brightness changes in Windows 10

Posted: 06 Nov 2018, 16:44
by kczx3
Neat!

Re: Detect screen brightness changes in Windows 10

Posted: 07 Nov 2018, 01:11
by lblb
Wow TLM! This is so much better than anything that I could've come up with! Apart from exploring the traditional WMI resources here and on the old forum, I never really dug into WMI. But you might just have pointed me to my next learning adventure!
Your code does exactly what I wanted. Perfect, thanks much!

Re: Detect screen brightness changes in Windows 10

Posted: 07 Nov 2018, 09:55
by TLM
Image
:D now if I could just remember how to init context,
in-class command calls would be more elegant lol