Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I shutdown my PC with Win32 API in C?

Tags:

c

winapi

I need a way using the Win32 API to force shutdown my machine.

I am currently using Windows 7 but O'd really like if the code would work for Vista and XP.

like image 675
dikidera Avatar asked Feb 23 '23 08:02

dikidera


1 Answers

Isn't ExitWindowsEx() enough for your needs?

like image 113
s.m. Avatar answered Feb 24 '23 23:02

s.m.