//适用于Win NT/2K/XP, //参数Key为True,屏蔽“任务管理器”;为False,“任务管理器”可用 //使用方法:
//DisableTaskmgr(True);
procedure DisableTaskmgr(Key: Boolean); Var Reg:TRegistry; Begin Reg:=TRegistry.Create; try Reg.RootKey := HKEY_CURRENT_USER; if Reg.OpenKey('/Software/Microsoft/Windows/CurrentVersion/Policies/System', True) then begin if Key then Reg.WriteString('DisableTaskMgr','1') else Reg.WriteInteger('DisableTaskMgr',0); Reg.CloseKey; end; except Reg.Free; end; end; |