Page 2 of 2 FirstFirst 12
Results 41 to 77 of 77

Thread: How do I... Disable Control Alt Delete?

  1. #41
    Hyperactive Member JXDOS's Avatar
    Join Date
    Aug 2006
    Location
    Mars...
    Posts
    423

    Re: How do I... Disable Control Alt Delete?

    actually. it al works... but i need to find a way to disable ctrl alt delete..
    If my post has been helpful, please rate it!

  2. #42
    Hyperactive Member JXDOS's Avatar
    Join Date
    Aug 2006
    Location
    Mars...
    Posts
    423

    Re: How do I... Disable Control Alt Delete?

    .. instead, i try to disable taskmgr with regedit.. but i don't know whats wrong with this.. plz check!

    VB Code:
    1. Microsoft.Win32.Registry.CurrentUser.CreateSubKey("Software\Microsoft\Windows\CurrentVersion\Policies\System", True).SetValue("DisableTaskmgr", 1, Microsoft.Win32.RegistryValueKind.DWord)

    *EDIT the error message says: The specified RegistryKeyPermissionCheck value is invalid.
    Parameter name: mode
    Last edited by JXDOS; Dec 31st, 2006 at 01:22 AM.
    If my post has been helpful, please rate it!

  3. #43
    Fanatic Member TTn's Avatar
    Join Date
    Jul 2004
    Posts
    708

    Re: How do I... Disable Control Alt Delete?

    actually. it al works... but i need to find a way to disable ctrl alt delete..
    I'm not sure anyone can help you, any more.

    Could you please find another thread to post your problems?


    Thanks

  4. #44
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: How do I... Disable Control Alt Delete?

    Quote Originally Posted by JXDOS
    actually. it al works... but i need to find a way to disable ctrl alt delete..
    Refer to post #2.

  5. #45
    New Member
    Join Date
    Jan 2007
    Posts
    3

    Thumbs up Re: How do I... Disable Control Alt Delete?

    Quote Originally Posted by wossname
    Ctrl Shift Esc just brings up the task manager.
    You can simply disable the task manager thru editing the windows registry.
    I already tried to see the result and it does really did a perfect solution. Not even a Ctrl-Shft-Esc can open the task manager. I tried it on a Windows XP, well.. I dont know if it works on some OS. You can include a command and function to your code modifying the windows registry on the following address..

    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System

    Create a new DWORD name "DisableTaskMgr"

    value Result
    1 Disable Task Manager
    0 Enable Task Manager

    I do hope this would help all those who needs this solution

    GoD Bl3Ss

  6. #46
    Fanatic Member TTn's Avatar
    Join Date
    Jul 2004
    Posts
    708

    Re: How do I... Disable Control Alt Delete?

    stealth_scanner,

    That code was included in the orginal example, but is not as good.
    You need certain rights, to set that in the registry.
    It displays a messagebox, telling you that the task manager is disabled by your administrator.
    This steals focus, and makes a nasty "bomp" sound.

    However here is a full solution using the registry:
    VB Code:
    1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    2.     On Error Resume Next
    3.     Dim regKey As RegistryKey
    4.     Dim regVal As String = ""
    5.     Registry.CurrentUser.CreateSubKey("Software\Microsoft\Windows\CurrentVersion\Policies\System")
    6.     regKey = Registry.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Policies\System", True)
    7.     regKey.SetValue("DisableTaskMgr", 1)
    8.     regKey.Close()
    9.     regKey = Registry.CurrentUser.OpenSubKey("Control Panel\Desktop", True)
    10.     regVal = regKey.GetValue("ScreenSaveActive")
    11.     If regVal = "1" Then
    12.         regKey.SetValue("ScreenSaveActive", "0")
    13.     End If
    14.     regKey.Close()
    15. End Sub
    16. Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    17.     On Error Resume Next
    18.     Dim regKey As RegistryKey
    19.     Dim regVal As String
    20.     Registry.CurrentUser.CreateSubKey("Software\Microsoft\Windows\CurrentVersion\Policies\System")
    21.     regKey = Registry.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Policies\System", True)
    22.     regKey.SetValue("DisableTaskMgr", 0)
    23.     regKey.Close()
    24.     regKey = Registry.CurrentUser.OpenSubKey("Control Panel\Desktop", True)
    25.     regVal = regKey.GetValue("ScreenSaveActive")
    26.     If regVal = "0" Then
    27.         regKey.SetValue("ScreenSaveActive", "1")
    28.     End If
    29.     regKey.Close()
    30. End Sub

  7. #47
    Fanatic Member
    Join Date
    Jan 2006
    Posts
    910

    Re: How do I... Disable Control Alt Delete?

    Wow TTn, very impressive. Works great! I will rate!

  8. #48
    Hyperactive Member JXDOS's Avatar
    Join Date
    Aug 2006
    Location
    Mars...
    Posts
    423

    Re: How do I... Disable Control Alt Delete?

    hoew do i fix an error which says: Unable to find manifest signing certificate in the certificate store?
    If my post has been helpful, please rate it!

  9. #49
    Fanatic Member TTn's Avatar
    Join Date
    Jul 2004
    Posts
    708

    Re: How do I... Disable Control Alt Delete?

    hoew do i fix an error which says: Unable to find manifest signing certificate in the certificate store?
    Sounds like a permission error.
    Do you have Administrator rights, as a window user?

  10. #50
    Hyperactive Member JXDOS's Avatar
    Join Date
    Aug 2006
    Location
    Mars...
    Posts
    423

    Re: How do I... Disable Control Alt Delete?

    yeh, when i use it in a newly created for with just 2 buttons it works but when i put it into a different one, it says that error.
    If my post has been helpful, please rate it!

  11. #51
    Fanatic Member
    Join Date
    Jan 2006
    Posts
    910

    Re: How do I... Disable Control Alt Delete?

    TTn, I see in your code where this is suppose to stop Alt F4. Most of it works so far but this doesn't work for me. I hit Alt and F4 and it shuts my program down. Any ideas?

  12. #52
    Hyperactive Member JXDOS's Avatar
    Join Date
    Aug 2006
    Location
    Mars...
    Posts
    423

    Re: How do I... Disable Control Alt Delete?

    this has been already posted. please refer to earlier posts
    If my post has been helpful, please rate it!

  13. #53
    Fanatic Member
    Join Date
    Jan 2006
    Posts
    910

    Re: How do I... Disable Control Alt Delete?

    JXDOS, Do you not see where I mention that I SEE in his code where it blocks Alt F4? Which means I have read this entire thread. So please don't waste my time asking me to read a thread, I don't post unless I read the thread. What I am saying is that all of it works except for that one on my PC and was asking if he had any idea why or what could cause that.

  14. #54
    Fanatic Member
    Join Date
    Jan 2006
    Posts
    910

    Re: How do I... Disable Control Alt Delete?

    Ok, now that's weird. Now none of it works. It all worked the other day and I haven't changed anything. It's copied directly from the thread.

  15. #55
    Fanatic Member
    Join Date
    Jan 2006
    Posts
    910

    Re: How do I... Disable Control Alt Delete?

    Ok, I figured it out. I forgot I couldn't use the VS IDE to run the code. I used the .exe directly from the release folder and it was working.

  16. #56
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: How do I... Disable Control Alt Delete?

    I guarantee that any code you might put in your app to get around ctrl+alt+delete I could easily bypass.

  17. #57
    Fanatic Member
    Join Date
    Jan 2006
    Posts
    910

    Re: How do I... Disable Control Alt Delete?

    How? If you don't mind me asking.

  18. #58
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: How do I... Disable Control Alt Delete?

    It depends on the method used to try to stop it.

    If you write some code that you feel will stop me from being able to do it, I would be more than happy to stress test it for you.

  19. #59
    Fanatic Member
    Join Date
    Jan 2006
    Posts
    910

    Re: How do I... Disable Control Alt Delete?

    What about the method metioned on this thread? Where it kills taskmgr when it opens?

  20. #60
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: How do I... Disable Control Alt Delete?

    which post number?

  21. #61
    Fanatic Member
    Join Date
    Jan 2006
    Posts
    910

    Re: How do I... Disable Control Alt Delete?

    Post #9. Where is says it kills taskmgr if ctrl alt del is pushed

  22. #62
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: How do I... Disable Control Alt Delete?

    I took all the code from post number 9, copied it into a new project and ran it...

    but it does nothing....
    Attached Images Attached Images  

  23. #63
    Fanatic Member
    Join Date
    Jan 2006
    Posts
    910

    Re: How do I... Disable Control Alt Delete?

    It doesn't work unless you build it and run it the .exe from the release folder. It works pretty well.

  24. #64
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: How do I... Disable Control Alt Delete?

    ok I will try

  25. #65
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: How do I... Disable Control Alt Delete?

    sorry Man, still doesn't prevent the task manager at all on my system... ctrl+alt+delete works just fine, and it doesn't get closed either...
    Attached Images Attached Images  

  26. #66
    Fanatic Member
    Join Date
    Jan 2006
    Posts
    910

    Re: How do I... Disable Control Alt Delete?

    Hmm.. That's weird. It works great on mine. I created a form the size of my screen, made it always on top and hide my taskbar and put that code in there. I d/l a list of shortcut keys and it blocked them all. I ended up having to reboot to get back out of it because I forgot to add a exit button.

  27. #67
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: How do I... Disable Control Alt Delete?

    how do you log onto windows XP? Do you use that weclome screen? or do you use the traditional login method where user name and password has to be typed?

    Are you using XP Pro or XP Home?

    Often times these types of differences will change the behavior of ctrl+alt+delete.

    For example, on XP home when you ctrl+alt+delete you simply get the taskmanager.

    On my system, I get the windows security dialog.

  28. #68
    Fanatic Member
    Join Date
    Jan 2006
    Posts
    910

    Re: How do I... Disable Control Alt Delete?

    XP Pro. I get the Windows Security Dialog also but when I click on task manager on that dialog it kills the task manager.

  29. #69
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: How do I... Disable Control Alt Delete?

    well, as you can see from my screen shot, it doesn't close mine.

    I'm not trying to fool anyone here... I would be more than happy to see real ctrl+alt+delete blocking code, but this code doesn't do ANYTHING that I can see when I run it. I compiled and ran the exe from windows in release mode just as you said.

  30. #70
    Fanatic Member TTn's Avatar
    Join Date
    Jul 2004
    Posts
    708

    Re: How do I... Disable Control Alt Delete?

    That is kinda weird, but as you see there's no problem detecting a Ctrl Alt Delete combo.
    It's not a problem to kill the task manager quickly.

    kleinma, it does seem like you're making it out to be some mythical legend perhaps to dissuade people from using it. No big deal either way.

    The task manager kill procedure, is on a timeout.
    Set it a little higher.
    I believe you can also create, and/or use this registry setting for that.
    HKEY_CURRENT_USER > Control Panel > Desktop > LowLevelHooksTimeout

  31. #71
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: How do I... Disable Control Alt Delete?

    no, I am just saying that I haven't seen any VB code to actually do it and have it work on my system.

    If you can give me code to do it fine, but now its sounding a bit silly, all sorts of registry hacks and such to try to make it work? I'm not going to go screwing around with my system to try to get it to work, when with the default settings my system is using now, it doesn't work.

    Maybe it works on some systems, but it obviously isn't fool proof...

  32. #72
    Fanatic Member TTn's Avatar
    Join Date
    Jul 2004
    Posts
    708

    Re: How do I... Disable Control Alt Delete?

    no, I am just saying that I haven't seen any VB code to actually do it and have it work on my system.
    If you can give me code to do it fine, but now its sounding a bit silly, all sorts of registry hacks and such to try to make it work? I'm not going to go screwing around with my system to try to get it to work, when with the default settings my system is using now, it doesn't work.
    Maybe it works on some systems, but it obviously isn't fool proof...
    Maybe it works on most systems, especially those where one wants to have this function.

    It's not a registry hack to Set it a little higher.
    An advanced version would sync up to the registry setting.
    Besides, you've already commited yourself here:
    I guarantee that any code you might put in your app to get around ctrl+alt+delete I could easily bypass.
    If you're still game, we can do this offline sometime.

  33. #73
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: How do I... Disable Control Alt Delete?

    sure if you update the code to the "advanced" version, I will be happy to try it again on my system, as well as Vista if you like.

    I am not bashing your code, or telling people not to use it. All I am saying is it doesn't work when I try it. I am not going to jump through hoops to figure out why, simply because I don't really care why it doesn't work.

    If it did work, I would then try to circumvent it, and see if that was possible.

    If I could not find a way around it, then I would concede and be more than happy to tell you I can't bypass it.

    Until then I am just stating for the record that this doesn't work on my XP Pro machine, I am just saying it in case someone comes along and thinks they could copy/paste this code into their app and the end user won't be able to hit ctrl+alt+delete

  34. #74
    Fanatic Member TTn's Avatar
    Join Date
    Jul 2004
    Posts
    708

    Re: How do I... Disable Control Alt Delete?

    If you are genuinely curious, try adding a little more time in the KillTaskManager loop. No fuss, no hoops to go through.

    I'd be willing to withdraw questionable, or missusable submissions, but the codeguru seems to have no problem with it.

    I am curious if this works on Vista, but I'd trust my own objective tests for that.

    It may be easier to circumvent the code if you've gotten a chance to look at it up close. But what if you didn't?
    I could circumvent it myself, in about five different ways back and forth.
    I'm not sure if there is an end to it...
    However there is no subjective guarantee either way, as you put it.
    Did you make any changes to the code, or your system before trying it?
    It looks a little like you have.

    Until then I am just stating for the record that this doesn't work on my XP Pro machine, I am just saying it in case someone comes along and thinks they could copy/paste this code into their app and the end user won't be able to hit ctrl+alt+delete
    For the record this code works on everyone elses PC except yours. You are the first person, of at least a dozen others.

  35. #75
    New Member
    Join Date
    Feb 2007
    Posts
    1

    Re: How do I... Disable Control Alt Delete?

    can someone build the executable for me as i am new at this so it stops ctrl+alt+del, ctrl+alt+esc, alt+F4 and win key
    Last edited by chrisal; Feb 28th, 2007 at 11:23 PM.

  36. #76
    Junior Member PriyankaB's Avatar
    Join Date
    Dec 2018
    Posts
    28

    Re: How to swap keyboard keys, ie press A but send Z

    Quote Originally Posted by TTn View Post
    'Here is an example of how to SwapKeys.
    'It's somewhat like SwapMouseButtons, but only for the keyboard.

    Code:
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            HookKeyboard()
        End Sub
        Private Sub Form1_Closed(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Closed
            UnhookKeyboard()
        End Sub
    
        Public Function IsHooked(ByRef Hookstruct As KBDLLHOOKSTRUCT) As Boolean
            On Error Resume Next
    
            If Hookstruct.flags <> 128 Then 'Do this on key down only.  the flag for key up is 0.
                If Hookstruct.vkCode = Keys.A Then 'If a key is pressed
                    apikeybd_event(Keys.Z, 0, 0, 0) 'press any key. (z in this example)
                    Return True
                End If
    
                'Repeat this skeleton for any key, or combo!!!  
                'If Hookstruct.vkCode = Keys.A Then
                '    apikeybd_event(Keys.Z, 0, 0, 0)
                '    Return True
                'End If
            End If
    
            Return False
        End Function
        Public Structure KBDLLHOOKSTRUCT
            Public vkCode, scanCode, flags, time, dwExtraInfo As Int32
        End Structure
        Public Delegate Function KeyboardHookDelegate(ByVal Code As Int32, ByVal wParam As Int32, ByRef lParam As KBDLLHOOKSTRUCT) As Int32
        <System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.FunctionPtr)> Private callback As KeyboardHookDelegate
        Public KeyboardHandle As Int32
        Const HC_ACTION As Int32 = 0
        Const WH_KEYBOARD_LL As Int32 = 13
        Const VK_CONTROL As Int32 = 17
        Public Declare Function apiSetWindowsHookEx Lib "user32" Alias "SetWindowsHookExA" (ByVal idHook As Int32, ByVal lpfn As KeyboardHookDelegate, ByVal hmod As Int32, ByVal dwThreadId As Int32) As Int32
        Public Declare Function apiCallNextHookEx Lib "user32" Alias "CallNextHookEx" (ByVal hHook As Int32, ByVal nCode As Int32, ByVal wParam As Int32, ByVal lParam As KBDLLHOOKSTRUCT) As Int32
        Public Declare Function apiUnhookWindowsHookEx Lib "user32" Alias "UnhookWindowsHookEx" (ByVal hHook As Int32) As Int32
        Public Declare Sub apikeybd_event Lib "user32.dll" Alias "keybd_event" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Int32, ByVal dwExtraInfo As Int32)
        Public Sub HookKeyboard()
            callback = New KeyboardHookDelegate(AddressOf KeyboardCallback)
            KeyboardHandle = apiSetWindowsHookEx(WH_KEYBOARD_LL, callback, System.Runtime.InteropServices.Marshal.GetHINSTANCE(System.Reflection.[Assembly].GetExecutingAssembly.GetModules()(0)).ToInt32, 0)
        End Sub
        Public Sub UnhookKeyboard()
            If KeyboardHandle <> 0 Then apiUnhookWindowsHookEx(KeyboardHandle)
        End Sub
        Public Function KeyboardCallback(ByVal Code As Int32, ByVal wParam As Int32, ByRef lParam As KBDLLHOOKSTRUCT) As Int32
            If Code = HC_ACTION AndAlso IsHooked(lParam) = True Then Return 1
            Return apiCallNextHookEx(KeyboardHandle, Code, wParam, lParam)
        End Function
    Hi TTn,
    Is this VB6, as i am getting lots of RED lines while pasting this code in VB6....

  37. #77
    Junior Member PriyankaB's Avatar
    Join Date
    Dec 2018
    Posts
    28

    Re: How to swap keyboard keys, ie press A but send Z

    Quote Originally Posted by PriyankaB View Post
    Hi TTn,
    Is this VB6, as i am getting lots of RED lines while pasting this code in VB6....
    Oops! Sorry, i was searching in VB6 thread and never knew how n when i entered in this .Net thread.

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width