Re: How to prevent ALt+F4
oops.... replace keys.control with keys.alt.... (it still doesnt work, tho)
Re: How to prevent ALt+F4
hmm.. well i fixed it by doing this:
VB Code:
If e.Alt Or e.Control Or e.KeyData = Keys.Delete = True Then
e.SuppressKeyPress = True
e.Handled = True
End If
but how do i disable CTRL + ALT + DEL?
Re: How to prevent ALt+F4
I may be wrong, but I have not seen any code that can do that yet. Its protected and it deals with the security dll - msgina.dll
Why do you need to prevent it? Maybe there is a workaround.
Re: How to prevent ALt+F4
well im making a custom locked computer screen... i have sucessfully prevented alt f4.... but ctrl alt del still works
Re: How to prevent ALt+F4
is it possible to do it via batch file or somthing?
Re: How to prevent ALt+F4
I dont know but I have read a few posts about creating your own desktop for something like what your doing and try a search for them. I think they were creating their own explorer shellor something. Its easier and helps to contain everything in that shell.
Re: How to prevent ALt+F4
ooh i figured it out....
i made a timer which sent the form to the front constantly, then i made a sub which gives it focus if it loses focus... so it goes in front of the task manager!
yay
Re: How to prevent ALt+F4
I have 'sort of' prevented ctrl+alt+del with an expirment or prototype for my last boss for a kiosk which was supposed be just a normal app but to lock out the user completely (assuming also they could not turn off the computer, not in same location as keyboard mouse etc)
i continously did this
Me.Show()
Me.SetTopLevel(True)
Me.Activate()
on the form, they r able to use ctrl+alt+del but it's rendered useless as they cant click anything on it, i cant remember but i did work out a few shortcut keys that still work in it
remember to use ctrl+pausebreak to end the project after you test this and don't run the exe
Re: How to prevent ALt+F4
Oh, you did the same thing anyway :)
Re: How to prevent ALt+F4
ya, except mine doesnt flicker... you have to put a me.focus() under the formlostfocus event and then make a timer that does me.bringtofront()....
and it has to be a topmost form
Re: How to prevent ALt+F4
disabletskmgr registry key. See article half way down this page:
http://www.devcity.net/newsletter/ar...ty20050715.htm
If you wanted to trap ctrl-alt-delete you would have to use msgina.dll, and you need to be able to use pointers properly (like in c++) - so you can't do it in c# or vb.net.
Re: How to prevent ALt+F4
I thought someone could shed some light on this. Thanks for the link and I was right too about the msgina.dll. :)
Re: How to prevent ALt+F4
well i have gotten it to work by forcing the window to always have focus and be ontop... so it goes ontop of the taskmanager rendering it useless... and i already disabled ALT+F4....
yay!
Re: How to prevent ALt+F4
this is probably the most malicious piece of code if ever wrote...
but it will do what you asked... in vista and in XP :)
vb.net Code:
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Me.BringToFront()
Me.Focus()
Me.TopMost = True
Me.Show()
Me.SetTopLevel(True)
Me.Activate()
Me.WindowState = FormWindowState.Maximized
Try
killProcess("LogonUI")
killProcess("taskmgr")
Catch ex As Exception
Return
End Try
End Sub
Public Sub killProcess(ByRef strProcessToKill As String)
Try
Dim proc() As Process = Process.GetProcesses
For i As Integer = 0 To proc.GetUpperBound(0)
If proc(i).ProcessName = strProcessToKill Then
proc(i).Kill()
End If
Next
Catch ex As Exception
Return
End Try
End Sub
Re: How to prevent ALt+F4
All of these methods are terrible and will not work if the computer is part of a domain (and thus, CTRL + ALT + DEL jumps to the management screen) or has a sane security policy.
If you're making a kiosk system you really should not use a consumer or server OS; you should be using an embedded OS (like Windows CE 6). If you're making some sort of locking screen... we'll you're just duplicating OS functionality and since it's not low level enough it means you'll be able to break it in one way or another despite what you do.
Also, killing processes is very bad. Especially if you're doing it by name as I could have a process called LogonUI that you're application is now killing rather than its true target. Let's not forget that you can't just kill random processes in Vista unless you have the appropriate security level.
Why was this thread dug from the grave anyway?
Re: How to prevent ALt+F4
Hey Latin4567 !!!!! can u please post the project so that curious people like me can try it out????????
thanking you in advance,
wiz....
Re: How to prevent ALt+F4
hey latin4567 !!!!can u post the project for dummies like me????
thanks in advance,
wiz....