Windows API

BlitzMax Forums/BlitzMax Beginners Area/Windows API

You aren't trying to do such stuff with a regular user account are you?


I also get the 1314 error when running as Administrator, so it looks like there is something weird going on indeed... I verified that the process in the taks manager's process list is running as 'administrator' indeed...

some more googling found others with similar issues, and supposedly "the caller requires the SE_SHUTDOWN_NAME privilege", whatever that means...
Supposedly there's a call for AdjustTokenPrivileges that needs to be invoked, but I have absolutely no idea on how to translate that to blitzmax...

I found some visual basic code that does it here:
http://www.vbaccelerator.com/home/VB/Tips/How_to_Shutdown_the_System_in_Windows_9x_and_NT/article.asp

but the syntax is very different from BlitzMax's API stuff and I haven't been able to get anything workable out of it. Anyone else has any idea on how to convert this?

All I'm trying to do is to programatically put my computer in Hibernation mode, but not having a whole lot of luck so far...