From: Bernd Giesen on
Hi,

does anyone know a way to programatically detect, if the machine (x86) is
going to sleep state (S1-S4). I thought about hooking into a notification
handler or something else. How could I manage that?

kind regards,
Bernd




From: Kellie Fitton on
On Jun 24, 11:13 am, Bernd Giesen <Bernd.Gie...(a)gmx.net> wrote:
> Hi,
>
> does anyone know a way to programatically detect, if the machine (x86) is
> going to sleep state (S1-S4). I thought about hooking into a notification
> handler or something else. How could I manage that?
>
> kind regards,
> Bernd



Hi,

The following Windows message notifies applications that
a power-management event has occurred:

WM_POWERBROADCAST

http://msdn.microsoft.com/en-us/library/aa373247(VS.85).aspx

Kellie.

From: Gisle Vanem on
"Bernd Giesen" wrote:

> does anyone know a way to programatically detect, if the machine (x86) is
> going to sleep state (S1-S4). I thought about hooking into a notification
> handler or something else. How could I manage that?

Detect and handle the WM_POWERBROADCAST message
(if you're not a console-app that is).

--gv
From: Bernd Giesen on
Kellie Fitton wrote:

> On Jun 24, 11:13�am, Bernd Giesen <Bernd.Gie...(a)gmx.net> wrote:
>> Hi,
>>
>> does anyone know a way to programatically detect, if the machine (x86) is
>> going to sleep state (S1-S4). I thought about hooking into a notification
>> handler or something else. How could I manage that?
>>
>> kind regards,
>> Bernd
>
>
>
> Hi,
>
> The following Windows message notifies applications that
> a power-management event has occurred:
>
> WM_POWERBROADCAST
>
> http://msdn.microsoft.com/en-us/library/aa373247(VS.85).aspx
>
> Kellie.

Thanks to all who replied.

regards,
Bernd