Results 1 to 12 of 12

Thread: disable the CTRL ALT DELETE key in visual basic.net

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2004
    Location
    Philippines
    Posts
    11

    disable the CTRL ALT DELETE key in visual basic.net

    Good day.

    I'm creating a simple form that could capture keystrokes. How can i capture CTRL-ALT-DELETE key when pressed together so as not to go to the task manager, in short I want to disable any function when the three keys is pressed. I tried to use the keydown event , detecting the three keys when pressed then set e.handled = true, but still it wont work

    How could i do it in VB.NET, any help would be greatly appreciated. please....

    THank you very much.

  2. #2
    Frenzied Member <ABX's Avatar
    Join Date
    Jul 2002
    Location
    Canada eh...
    Posts
    1,622
    Not possible in win 2k/xp....
    Tips:
    • Google is your friend! Search before posting!
    • Name your thread appropriately... "I Need Help" doesn't cut it!
    • Always post your code!!!! We can't read your mind!!! (well, at least most of us!)
    • Allways Include the Name and Line of the Exception (if one is occuring!)
    • If it is relevant state the version of Visual Studio/.Net Framwork you are using (2002/2003/2005)


    If you think I was helpful, rate my post
    IRC Contact: Rizon/xous ChakraNET/xous Freenode/xous

  3. #3
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489
    can he not capture the ascii character of one or all three concatenated and escape the event sequence? I did that with a custom control that accepts only numbers and nothing else.

  4. #4
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    No, the event never gets passed to the app from the OS, acting as if no key was ever pressed.

  5. #5
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    Originally posted by Andy
    can he not capture the ascii character of one or all three concatenated and escape the event sequence? I did that with a custom control that accepts only numbers and nothing else.
    No, because two out of the three keys (Ctrl & Alt) have no ASCII.... they are not characters, they are keyes.

    Originally posted by nemaroller
    No, the event never gets passed to the app from the OS, acting as if no key was ever pressed.
    Right, makes sense to me. As the keys are sent through the keyboard IRQ, the OS picks up that the Ctrl-Alt-Del keys were hit, and goes into the Task Manager mode. The key strokes never make it to the app.

    The only way this is going to work is if the OS didn't intercept the keystrokes and always sent everything. Which used to be possible (pre Win2k). I don't know if it istill is or not. It could a couple of APIs to get it done (and no, I don't know what they are either.)

    There is a danger of diabling the C-A-D keystrokes though. God forbid that something goes horribly wrong and they need to three-finger salute to get out of an app. Suddenly, it doesn't work! So, use it wisely.

    TG
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  6. #6
    Lively Member
    Join Date
    Nov 2003
    Location
    Iowa
    Posts
    96
    I"m confused why you want to use those keys anyway...why don't you just use some other keys to take a screenshot?
    It is like wiping your ass with silk, I love it!

  7. #7
    Lively Member
    Join Date
    Nov 2003
    Location
    Iowa
    Posts
    96
    haha whoops...keystrokes w00t w00t, lol i'm dumb sorry i'll shut up...are you making a key-logger?

    I bet there is a way to make your program know that Windows did it's thing when the keys were pressed, so...

    If windowsdoesit'sthing = true Then
    Control+Alt+Delete were pressed
    End If

    maybe...maybe not
    It is like wiping your ass with silk, I love it!

  8. #8
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    Besides which, any windows application made in the Philipines since the 'I love U' virus, automatically does not work in the West.

  9. #9

    Thread Starter
    New Member
    Join Date
    Mar 2004
    Location
    Philippines
    Posts
    11
    thnx for ur replies. Im a newbie programmer in vb.net, can anyone provide me a code that disables keypress ( ctrl-ESC, ALT-ESC, windows keys, ALT-TAB, CTRL-ALT-DEL), or links of tutorials on how to hook this keys.

    thank you very much

  10. #10
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    You need to use Win32 API's for this. I think someone mentioned that.

    Just be warned, you better be careful, because messing with hooks will screw your system faster than a 1800xp Athlon without its heatsink.

  11. #11

    Thread Starter
    New Member
    Join Date
    Mar 2004
    Location
    Philippines
    Posts
    11
    ok. I only need tutorials and code snippets so that I can get a fresh start.

    TNX.

  12. #12
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    Last edited by nemaroller; Jul 14th, 2004 at 09:22 PM.

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