C# 中的全屏应用程序:
using System;
using System.Windows.Forms;
namespace FullScreen
{
static class Program
{
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
var fullscreen = new Form();
fullscreen.TopMost = true;
fullscreen.WindowState = FormWindowState.Maximized;
fullscreen.MinimizeBox = false; // remove minimize button
fullscreen.MaximizeBox = false; // remove maximize button
fullscreen.ControlBox = false; // remove X button
fullscreen.FormBorderStyle = FormBorderStyle.None;
Application.Run(fullscreen);
}
}
}
使用globalmousekeyhook禁用 Alt+Tab :
using Gma.System.MouseKeyHook;
var hook = Hook.GlobalEvents();
hook.KeyDown += (o, e) =>
{
if (e.Alt) e.Handled = true;
};
同样,您可以禁用Win大部分,除了Win+ L(锁定屏幕)。
hook.KeyDown += (o, e) =>
{
if (e.KeyCode == Keys.LWin || e.KeyCode == Keys.RWin) e.Handled = true;
};
禁用Ctrl++可以通过使用 Registry Key 将至少一个键重新映射为Alt空。但是,写入该注册表项需要权限。您可以使用SharpKeys进行尝试,只是警告您可能会永久搞砸您的系统。DeleteSystem\CurrentControlSet\Control\Keyboard Layout