Hi, Royce
You have to use ExitWindowsEx API and here is example, which I use with
EWX_SHUTDOWN
[DllImport("user32.dll", ExactSpelling=true, SetLastError=true) ]
internal static extern bool ExitWindowsEx( int flag, int reason );
public const int EWX_LOGOFF = 0x00000000;
public const int EWX_SHUTDOWN = 0x00000001;
public const int EWX_REBOOT = 0x00000002;
public const int EWX_FORCE = 0x00000004;
public const int EWX_POWEROFF = 0x00000008;
public const int EWX_FORCEIFHUNG = 0x00000010;
{
flg=EWX_SHUTDOWN;
ExitWindowsEx( flg, 0 );
}
HTH
Alex