Code 1//引入命名控件: 2using Microsoft.Win32; 3using System.Runtime.InteropServices; 4 5[DllImport("user32.dll", EntryPoint = "FindWindowA")] 6public static extern IntPtr FindWindowA(string lp1, string lp2);//获取任务栏 7 8[DllImport("user32.dll", EntryPoint = "ShowWindow")] 9public static extern IntPtr ShowWindow(IntPtr hWnd, int _value);//显示/隐藏任务栏1011/**//// <summary>12/// 是否屏蔽CTRL+ALT+DEL13/// </summary>14/// <param name="i">1=屏蔽 0=取消屏蔽</param>15public static void ShieldMissionTask(int i)16{17try18{19//屏蔽 Ctrl + Alt + Del 键20RegistryKey key = Registry.CurrentUser;21RegistryKey key1 = key.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\System");22 key1.SetValue("DisableTaskMgr", i, Microsoft.Win32.RegistryValueKind.DWord);23}24catch (Exception ex)25{26throw ex;27}28}2930/**//// <summary>31/// 是否显示任务栏32/// </summary>33/// <param name="i">5=显示 0=隐藏</param>34public static void ShieldTaskBar(int i)35{36try37{38IntPtr hTray = FindWindowA("Shell_TrayWnd", String.Empty); //获取任务栏39ShowWindow(hTray, i); //隐藏任务栏40}41catch (Exception ex)42{43throw ex;44}45} 转载于:https://www.cnblogs.com/gossip/archive/2008/10/17/1313228.html