开发者

How to detect when screen brightness or system volume changed?

开发者 https://www.devze.com 2022-12-12 04:43 出处:网络
I want to detect when either of these changes and display an overlay on screen showing the current level. If there is a tool for this, then please poi开发者_StackOverflow社区nt me to it. But if not ho

I want to detect when either of these changes and display an overlay on screen showing the current level. If there is a tool for this, then please poi开发者_StackOverflow社区nt me to it. But if not how would I programatically get this (C#)?


The WmiMonitorBrightness class might be what you're looking for. You'll probably need to periodically query it to get changes.


If you talking about the softwares especially for laptops which OEMs like Dell/IBM etc give along with the windows installation to indicate brightness/voulme etc change then try this approach.

Install global message hooks and see what message is posted when volume/brightness buttons are clicked. You can use spy++ to detect the value of the message. In my opinion each vendor would have a different code for the buttons which are generally used along with the Function(Fn) key. Once you know the messages, make an application which installs a global hook for the system and display the animation or level bar as per your requirement.

The WmiMonitorBrightness class is supported for vista and above so if you using Win XP then it might not help you.

0

精彩评论

暂无评论...
验证码 换一张
取 消