Can't catch sleep/suspend messages (winXP)

前端 未结 5 1815
死守一世寂寞
死守一世寂寞 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 06:48

    I tried this same code in a test app on my (dev) machine & on a different (test) machine (also winXP). On my machine, it continues to fail, meaning the machine goes into sleep. But on the other machine, it works! At first I thought this was a debug vs release mode issue, but that's not the case.

    It seems that something is different about my dev machine, though I have no idea what it could be.

    Mystery solved... sorta.

提交回复
热议问题