Recent

Author Topic: Auto Shutdown Windows  (Read 23986 times)

CCRDude

  • Hero Member
  • *****
  • Posts: 596
Re: Auto Shutdown Windows
« Reply #15 on: December 13, 2018, 07:33:18 am »
@kinlion: it's nice that you found an alternate way, but why do you think it would be better to use? Direct API usage allows to interpret possible error reasons at a fine level, while your example, well, runs. You can't evaluate if its failing because a driver blocks the reboot, or shutdown is prohibited for your privileges, or ...

kinlion

  • Jr. Member
  • **
  • Posts: 82
  • I Love Lazarus
Re: Auto Shutdown Windows
« Reply #16 on: December 14, 2018, 10:20:57 am »
@kinlion: it's nice that you found an alternate way, but why do you think it would be better to use? Direct API usage allows to interpret possible error reasons at a fine level, while your example, well, runs. You can't evaluate if its failing because a driver blocks the reboot, or shutdown is prohibited for your privileges, or ...

OK. I just feel the code is simple :)

 

TinyPortal © 2005-2018