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
Printable View
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
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.
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.Quote:
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 don't know about NT, but i know you can do it with 98.
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.
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.