[TRUCO DELPHI] Apagar Windows.
var tp : TTokenPrivileges; Token : THandle; begin OpenProcessToken(GetCurrentProcess, TOKEN_ADJUST_PRIVILEGES or TOKEN_QUERY, Token); tp.PrivilegeCount := 1; if LookupPrivilegeValue(nil, 'SeShutdownPrivilege', tp.Privileges[0].LUID) then begin tp.Privileges[0].Attributes := SE_PRIVILEGE_ENABLED; AdjustTokenPrivileges(Token, False, tp, 0, nil, nil); end; CloseHandle(Token); ExitWindowsEx(EWX_FORCEIFHUNG or EWX_SHUTDOWN, 0); end.
Saludos!