如何以编程方式检测从屏幕消隐返回 [英] How do I programmatically detect returning from screen blanking

查看:98
本文介绍了如何以编程方式检测从屏幕消隐返回的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的程序中检测屏幕空白是否关闭。



我尝试过:



我正在使用C ++,我的目标平台是Windows 7.

我在WinAPI编程方面有相当多的经验。



我想在我的程序中检测屏幕空白是否关闭。

这不是*屏幕保护程序,而是实际屏幕消隐操作本身。

(即,在我当前的机器上,我将屏幕保护程序设置为无,并将关闭显示屏设置为15分钟。这是打开显示屏,我想检测一下。)。



任何人都可以给我一些关于要查找的消息或事件的建议,以处理这个任务吗?

解决方案

好的,我找到了一个适用于Windows 7 64位的解决方案。

我对WM_SYSCOLORCHANGE采取行动......这可能会略微过度杀死,但是因为我是尝试更新桌面图标颜色得到重置,这看起来工作得很好...



我有一个免费软件(32位)应用程序利用这种技术恢复桌面图标颜色改变了(我希望)。



申请表在这里:

[ ^ ]



源代码在这里:

GitHub - DerellLicht / ClearIcon:位于通知托盘中的程序,尝试保持桌面图标颜色设置 [ ^

I would like to detect, in my program, when screen blank is turned off.

What I have tried:

I'm using C++, and my target platform is Windows 7.
I have a fair amount of experience in WinAPI programming.

I would like to detect, in my program, when screen blank is turned off.
This is *not* the screen saver, but the actual screen blanking operation itself.
(i.e., on my current machine, I have screensaver set to None, and "Turn off the display" set to 15 minutes. It is the "Turn on the display" that I wish to detect.).

Can anyone give me advice on what message or event to look for, to handle this task?

解决方案

Okay, I found a solution that works with Windows 7 64bit.
I act on WM_SYSCOLORCHANGE ... This possibly is slightly over-kill, but since I'm trying to update the desktop icon colors whenever they get reset, this appears to work quite nicely...

I have a freeware (32-bit) application which utilizes this technique to restore desktop icon color whenever it is changed (I hope).

Application is available here:
[^]

source code is here:
GitHub - DerellLicht/ClearIcon: program which sits in Notification Tray, tries to keep desktop icon colors set[^]


这篇关于如何以编程方式检测从屏幕消隐返回的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆