delphi的hibernate推送和检测 [英] delphi hibernate push and detect

查看:211
本文介绍了delphi的hibernate推送和检测的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Delphi5。

我有一个从Windows启动开始的应用程序,我想关闭并启动它在Hibernate / Wake命令。

I have an app that starts with windows boot and I would like to Close and Start it on the Hibernate/Wake command.

我需要能够检测到它是否从Hibernate回来,所以我可以每次运行我的应用程序。我在注册表中有一个设置,用户可以选择每天只运行一次。

I need to be able to detect if it is coming back from an Hibernate so I can run my app each time. I have a setting in the Registry where the User can choose to run only once per day.

我猜测有一个Windows消息或注册表项,告诉机器它将从Hibernate进入并返回。

I am guessing there is a windows Message or Registry entry that tells the machine that it is going into and coming back from an Hibernate.

想法和建议?

感谢您的看法

推荐答案

您可以通过监听 WM_POWERBROADCAST
消息在您的应用程序。此消息将发送到所有正在运行的
应用程序,通知电源管理事件已发生。这个消息的wParam部分是您可以检查系统是否进入挂起状态( PBT_APMSUSPEND )或从一个恢复( PBT_APMRESUMESUSPEND )。

You could achieve such application behaviour by listening for the WM_POWERBROADCAST message in your application. This message is sent to all running applications notifying that a power-management event has occurred. wParam part of this message is where you can check if the system is entering a suspended state(PBT_APMSUSPEND) or recovering from one(PBT_APMRESUMESUSPEND).

这篇关于delphi的hibernate推送和检测的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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