如何取消开始键
来源:百度知道 编辑:UC知道 时间:2024/05/03 02:32:40
新建一个文本文档,输入:
REGEDIT4
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"= hex: 00,00,00,00,00,00,00,00,03,00,00,00,00,00,5b,e0,00,00,5c,e0,00,00,00,00
此文件保存成扩展名为.reg的注册文件,比如取名为NoWin.reg。鼠标双击,点击"确定",注销,键盘上的Windows键就会不起作用了
如果需要恢复Windows键的功能,新建一个文本文档,输入:
REGEDIT4
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"= hex: 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
将它导入到注册表里之后,注销,就可使Windows键恢复如初
重写基类中的 ProcessCmdKey 方法
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
switch (keyData)
{
case Keys.RWin: //右边的win键
//这里写你要执行的方法 如果禁止 则为空好了
return true;
case Keys.LWin: //左边的win键
//这里写你要执行的方法
return true;
case Keys.Alt: //Alt键
//这里写你要执行的方法
return true