Results 1 to 7 of 7

Thread: keypress

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2002
    Posts
    111

    keypress

    does anyone know what the code would be for when i press CTRL + ALT + DEL on my keyboard the form i am on (form1) will switch to another form (form2)

    thanks in advance
    <<< Foxy >>>

  2. #2
    Addicted Member
    Join Date
    Nov 2001
    Posts
    153

    can only be done on 9x

    I think that you can only test for Ctrl + Alt or Alt + Del etc, I do not think you can test for all keys down at the same time (not without setting one of their values to false). And I think it will only work on Windows 9x systems, on later ones you would just get the task viewer thing.

  3. #3
    Lively Member
    Join Date
    Nov 2001
    Location
    i live where you don't
    Posts
    76
    find a code snippet to disable ctrl alt + del. use a timer and in its event, use GetAsyncKeyState to check to see if they're all pressed. if they are, then go ahead and show form2.

  4. #4
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    Originally posted by KrazyGamer
    find a code snippet to disable ctrl alt + del. use a timer and in its event, use GetAsyncKeyState to check to see if they're all pressed. if they are, then go ahead and show form2.
    I have never seen code to disable control+alt+delete. There is code to disable the task manager, but you will still get a window on NT systems because ctrl+alt+delete is very secure in the NT kernel.
    <removed by admin>

  5. #5
    Lively Member
    Join Date
    Nov 2001
    Location
    i live where you don't
    Posts
    76
    i don't know about NT, but i know you can do it with 98.

  6. #6
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628
    ive never used nt, but supposedly telling windows its running a screen saver works.
    im not sure, but i dont think you can test for one of the keys with getasynckeystate (alt key?) maybe im wrong, but i always tested with getkeyboardstate, since it takes a snapshot of every key position making it real easy to determine if any number of keys are pressed at the same time.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  7. #7
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    VB Code:
    1. Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
    2. Const VK_DELETE = &H2E
    3. Const VK_CONTROL = &H11
    4. Const VK_MENU = &H12
    5. 'set the interval to 1 millisecond on a timer control
    6. Private Sub Timer1_Timer()
    7. If GetAsyncKeyState(VK_CONTROL) <> 0 And GetAsyncKeyState(VK_MENU) <> 0 And GetAsyncKeyState(VK_DELETE) <> 0 Then
    8.   MsgBox "Control+Alt+Delete was pressed"
    9. End If
    10. End Sub

    As you can see, this code won't work on Windows 2000. Not sure about any operating system, but I doubt it will work on anything with the NT kernel in it.
    <removed by admin>

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