문제

using Delphi5.

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

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.

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.

Thoughts and suggestions?

Thanks for looking at this question.

도움이 되었습니까?

해결책

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).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top