|
-
Oct 18th, 2002, 02:10 PM
#1
Thread Starter
Lively Member
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 >>> 
-
Oct 18th, 2002, 02:30 PM
#2
Addicted Member
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.
-
Oct 18th, 2002, 04:14 PM
#3
Lively Member
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.
-
Oct 18th, 2002, 04:17 PM
#4
PowerPoster
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.
-
Oct 18th, 2002, 11:48 PM
#5
Lively Member
i don't know about NT, but i know you can do it with 98.
-
Oct 19th, 2002, 12:07 AM
#6
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.
-
Oct 19th, 2002, 01:11 AM
#7
PowerPoster
VB Code:
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Const VK_DELETE = &H2E
Const VK_CONTROL = &H11
Const VK_MENU = &H12
'set the interval to 1 millisecond on a timer control
Private Sub Timer1_Timer()
If GetAsyncKeyState(VK_CONTROL) <> 0 And GetAsyncKeyState(VK_MENU) <> 0 And GetAsyncKeyState(VK_DELETE) <> 0 Then
MsgBox "Control+Alt+Delete was pressed"
End If
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|