I want to know which is the best practice when a piece of software needs to restart, shutdown, logoff or hibernate Windows:
- Use ExitWindowsEx API
- Use Shutdown command and its parameters
What is the advantages and disadvantages of each approach?
Thanks
I always prefer calling the API (
ExitWindowsEx,InitiateSystemShutdown).Pro API
Pro external tool