Quote Originally Posted by Rob123
Try this out:
VB Code:
  1. Private Function blockTaskManager(Optional disable As Boolean = True) As Boolean
  2. On Error GoTo Fail
  3. Static fileNumber As Integer
  4. If disable Then
  5.     fileNumber = FreeFile
  6.     Open "C:\WINDOWS\system32\taskmgr.exe" For Random Lock Read Write As #fileNumber
  7. Else
  8.     Close #fileNumber
  9. End If
  10.    
  11. blockTaskManager = True
  12. Exit Function
  13. Fail:
  14. blockTaskManager = False
  15. End Function
  16.  
  17. Private Sub Command1_Click()
  18. 'Block task manager
  19. blockTaskManager
  20. End Sub
  21.  
  22. Private Sub Command2_Click()
  23. 'Unblock it
  24. blockTaskManager False
  25. End Sub
That disables the task manager when the thread poster wants to disable the Ctl+Alt+Del keypress combination. It brings up the windows Security dialog.