Its me with my questions again :)
Does anyone know if/how you can make a c++ program that checks to see if the user presses the power button on their computer? And if so, how?
That'll be handled in the ACPI. That's where you can start your investigation.
I've never needed to look into this stuff to date.