[wxMSW][wx3.0.3] Detecting PC sleep/wake Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Rudra
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 224
Joined: Fri Sep 13, 2013 2:59 pm

[wxMSW][wx3.0.3] Detecting PC sleep/wake

Post by Rudra »

Hi,

I want to detect if PC is going in sleep mode or when it wake up. I couldn't find a way to do so. I tried wxEVT_HIBERNATE but it doesn' t work for sleep.
I use wxEVT_QUERY_END_SESSION to detect if PC is shutting down and it works fine. I want similar for sleep or wake.

Please suggest.

Thanks,
R.
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4204
Joined: Sun Jan 03, 2010 5:45 pm

Re: [wxMSW][wx3.0.3] Detecting PC sleep/wake

Post by PB »

FWIW, there is wxEVT_POWER_SUSPENDED and wxEVT_POWER_RESUME
I have never used it so I do not know whether it does what you want and it is also available only on MSW.
Rudra
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 224
Joined: Fri Sep 13, 2013 2:59 pm

Re: [wxMSW][wx3.0.3] Detecting PC sleep/wake

Post by Rudra »

Thanks for the reply.
PB wrote: Thu Dec 05, 2019 12:48 pm there is wxEVT_POWER_SUSPENDED and wxEVT_POWER_RESUME

It works.

Thanks,
R.
Post Reply