PDA

View Full Version : ExitWindowsEx() not working?


jeanl
23rd June 2005, 22:25
Guys,
I'm trying to use ExitWindowsEx() to shutdown my system after a long encode, but somehow, this is not working. The function returns 0 with an error coe of 1324 "A required privilege is not held by the client."
Any idea what's wrong? I'm on XP, and there's not supposed to be any priviledge for that?!
jeanl

Doom9
23rd June 2005, 22:57
actually, there is for W2K and XP. See http://www.pinvoke.net/default.aspx/user32.ExitWindowsEx

and http://www.softgames.de/forum/frage29607.html for some C code

jeanl
23rd June 2005, 23:19
Thanks Doom9, I figured it out (went to the microsoft site where they have some sample code:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/how_to_shut_down_the_system.asp

But you beat me to it (hey, I had to wait for my system to go back up!)
Thanks anyway!
Jeanl

Darksoul71
24th June 2005, 16:15
A more simplistic approach that works with a variety of Window$ versions would be to use an external application such as wizmo.

-D$