Can't catch sleep/suspend messages (winXP)

前端 未结 5 1793
死守一世寂寞
死守一世寂寞 2020-12-16 06:38

My app needs to block sleep/hibernate mode. I have the code in place, but after successfully catching the WM_POWERBROADCAST message, neither PBT_APM

5条回答
  •  温柔的废话
    2020-12-16 07:05

    Are you running on Vista or Windows Server 2008? This page says

    Due to changes in the Power Management Model for Windows Vista and Windows Server 2008, the PBT-APMQUERYSUSPEND event is no longer delivered to applications. Instead the BT_APMSUSPEND event is delivered...

    Could that be why you're not seeing it?

提交回复
热议问题