My program performs a task on the hard disk free space. The task is quite long, it takes 1-2 hours.
The problem is that on laptop the hard disk may be t
Windows does not allow applications to disable power control changes, because buggy applications were causing batteries to be drained. See http://blogs.msdn.com/b/oldnewthing/archive/2007/04/16/2148139.aspx
You can get notified when the system power status is about to be changed. See WM_POWERBROADCAST Messages.