It depends on whether you want to use APM (Advanced Power Management) or ACPI (Advanced Configuration and Power Interface) specifications. Both of these specifications provide standard methods for working with different power functions, including shutting down.
i searched for Advanced Power Management to use it to shutdown the computer using C but i found nothin useful ,could you send me some references or links or code to let the computer shutdown.