Is there any method to disable logoff,lock and taskmanager in ctrl+alt+del in C#

前端 未结 4 1343
逝去的感伤
逝去的感伤 2020-12-19 23:49

On running my window application. if the user press ctrl+alt+del i need to disable these buttons..is there any method

相关标签:
4条回答
  • 2020-12-20 00:26

    I was having the same question. I had to not let the user having access to the Ctrl+Alt+Del functionality. I did find a workaround to disable them. I changed the keyboard mapping inside the registry. As removing the Ctrl-Alt-Del functionality can be dangerous, I just switch the Alt key by the ScrollLock key. To do so, you will need to add the following registry key (see this website for more explanation, you can find the keyboard scan code everywhere if you want to change the ScrollLock by another key but here a link):

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout
    
    Key Name: Scancode Map
    Type: Binary
    Value to enter: 
    00 00 00 00 
    00 00 00 00 
    03 00 00 00 => represent the number of keys you are modifying + 1 (for some reason, mapping to another key is not counting as 1)
    00 00 38 00 => Left-Alt key is 38 00 so here we give 00 00 (nothing) to the Left-Alt key. It will disable it.
    38 00 46 00 => ScrollLock key is 46 00 so here we give the Left-Alt key functionality to our ScrollLock key. ScrollLock will be Alt key now.
    00 00 38 E0 => Right-Alt key is 38 E0 so here we give 00 00 (nothing) to the Right-Alt key. It will disable it.
    00 00 00 00 => Terminator
    

    Hope it helps one of you! You will just need to register this key in your application but be aware that it will impact the entire system!

    0 讨论(0)
  • 2020-12-20 00:30

    I certainly hope not - the Ctrl-Alt-Del key combination is intercepted by the operating system and is never passed to applications. This is a security measure: if the user presses Ctrl-Alt-Del, it is guaranteed that what the user will see is the login screen / task manager (depending on which Windows version you have), not some application that tries to steal his password (I'm not implying that that's your intention, but such applications are what Ctrl-Alt-Del is designed to prevent).

    0 讨论(0)
  • 2020-12-20 00:45

    If I remember correctly, CTRL-ALT-DEL is the only key combination you can't override.

    0 讨论(0)
  • 2020-12-20 00:48

    You can not disabled them, but maybe you like to disable the task manager, and or the lock down.

    Disable Lock Workstation button:
    Hive: HKEY_CURRENT_USER
    Key: Software\Microsoft\Windows\CurrentVersion\Policies\System 
    Name: DisableLockWorkstation 
    Type: REG_DWORD
    Value: 1 disable
    
    Disable Task Manager button: 
    Hive: HKEY_CURRENT_USER
    Key: Software\Microsoft\Windows\CurrentVersion\Policies\System 
    Name: DisableTaskMgr
    Type: REG_DWORD
    Value: 1 disable
    

    Also you can consider

    Disable Change Password button: 
    Hive: HKEY_CURRENT_USER
    Key: Software\Microsoft\Windows\CurrentVersion\Policies\System 
    Name: DisableChangePassword 
    Type: REG_DWORD
    Value: 1 disable
    
    Disable Logoff button: 
    Hive: HKEY_CURRENT_USER
    Key: Software\Microsoft\Windows\CurrentVersion\Policies\Explorer Note: change from System to Explorer
    Name: NoLogoff
    Type: REG_DWORD
    Value: 1 disable
    
    0 讨论(0)
提交回复
热议问题