Click here to Skip to main content
15,566,065 members
Please Sign up or sign in to vote.
1.67/5 (2 votes)
See more:
I want to be able to detect when the user shutsdown, retsrta, logs off,sleeps or hibernates and send a message when this happens. I need to do this in c++. If someone can give me an example, I would greatly appreciate it.
Afzaal Ahmad Zeeshan 25-Mar-15 22:58pm    
If you can get notified when these events occur, you can then inside event handler right the code to log these events. Can't you?
Sergey Alexandrovich Kryukov 26-Mar-15 1:26am    
There plenty information on this topic, but it looks like different distro are equipped with different components involved in power management. You can do your search.

1 solution

Please see this very general information:[^].

You can find a lot of information:[^].

You need to find out what is installed in your distro and some other ones. This is the documentation for Ubuntu, just in case:[^].

Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900