Detect screen brightness changes in Windows 10 Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
lblb
Posts: 129
Joined: 30 Sep 2013, 11:31

Detect screen brightness changes in Windows 10

06 Nov 2018, 04:52

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!
User avatar
TLM
Posts: 1418
Joined: 01 Oct 2013, 07:52
GitHub: TLMcode
Contact:

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

06 Nov 2018, 15:40

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
for direct help, tweet at me: https://twitter.com/CW_DTech
lblb
Posts: 129
Joined: 30 Sep 2013, 11:31

Re: Detect screen brightness changes in Windows 10

07 Nov 2018, 01:11

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!
User avatar
TLM
Posts: 1418
Joined: 01 Oct 2013, 07:52
GitHub: TLMcode
Contact:

Re: Detect screen brightness changes in Windows 10

07 Nov 2018, 09:55

Image
:D now if I could just remember how to init context,
in-class command calls would be more elegant lol
for direct help, tweet at me: https://twitter.com/CW_DTech

Return to “Ask For Help”

Who is online

Users browsing this forum: A_Perry_1984, Google [Bot], mslonik, Spikea, TAC109 and 238 guests