Frage

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.

War es hilfreich?

Lösung

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

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top