uses jwaNative; //這裡請移步到 http://jedi-apilib.sourceforge.net/
{$R *.dfm}
function TForm1.ExWindows(const AFlag: Word): Boolean; var vi: TOSVersionInfo; hToken: THandle; tp: TTokenPrivileges; h: DWord;
begin Result:=False; vi.dwOSVersionInfoSize:=SizeOf(vi); If GetVersionEx(vi) then begin If vi.dwPlatformId = VER_PLATFORM_WIN32_NT then begin If OpenProcessToken(GetCurrentProcess, TOKEN_ADJUST_PRIVILEGES, hToken) then begin LookupPrivilegeValue(nil, 'SeShutdownPrivilege', tp.Privileges[0].Luid); tp.PrivilegeCount:=1; tp.Privileges[0].Attributes:=SE[1] [2] 下一页
|
|