In C#, it is still the same ExitWindowsEx API call.
class Class1
{
[DllImport("user32.dll")]
static extern bool ExitWindowsEx(uint uFlags, uint
dwReason);
[STAThread]
static void Main(string[] args)
{
ExitWindowsEx(1, 0); //this will cause the system to
shut down.
}
}
uFlags
4 = Force any applications to quit instead of prompting the user to close
them.
0 = Log off the network.
8 = Shut down the system and, if possible, turn the computer off.
2 = Perform a full reboot of the system.
1 = Shut down the system.
"Herbert VON GRÜNENWALD" <he*******************@microsoft.com> wrote in
message news:OI**************@TK2MSFTNGP09.phx.gbl...
in c++ it was ExitWindowsEx()
thanks