I never programmed a winapi so i have a little problem here .
I need turn off my pc from my application .
I found this example link text the
http://msdn.microsoft.com/en-us/library/aa376868(VS.85).aspx
Try
ExitWindowsEx(EWX_POWEROFF, 0);