I Faced This Issue Before When Working On A Program That Prevent The User From Continue Using The Computer After Certain Amount Of Time And Also Preventing Him From Kill My Program By Pressig The ALT + CTRL + DEL Combination..
I Tested It IN Windows XP OS.
Here's The Idea... I Got 2 Solutions:
-------------------------------------
1- You Can Disable The Task Manager [TaskMgr.exe].
2- You Can Run Task Maager and Hide It.
Working ON Solution [1]:
------------------------
You Can Set A Registry Value to Enable Or Disable The Task Manager From Being Fired. The Value IS:
---------------------------------------
*** Disable TaskMgr:
--------------------
"HKEY_CURRENT_USER\SOFTWARE\MICROSOFT\WINDOWS\CURENTVERSION\POLICIES\SYSTEM\DISABLETASKMGR" -->> set to 1
-- Desciption:
--------------
HKEY: "HKEY_CURRENT_USER"
PATH: "SOFTWARE\MICROSOFT\WINDOWS\CURENTVERSION\POLICIES\SY STEM"
VALUE: "DisableTaskMgr"
DATA: 1 -- Data Type LONG
----------------------------------------------------
====================================================
*** Enable TaskMgr:
--------------------
You Can Either Delete The Registry Value Or Set The Data to 0
'------ But Don't Forget To Enable The TaskMgr After You Closed You Program.
================================
Working ON Solution [2]:
------------------------
You Can Run The [TaskMgr.exe] When You Start Your Program And Hide It, If User Try To Press The ALT+CTRL+DEL It Will Do Nothing Except In Some Times Can Get The Focus On The [TaskMgr.exe] But It's Hidden, So User Can't See It.
To Avoid Getting The Focus To [TaskMgr.exe] You can Put a timer on Your Active Form And Let This Timer Make Your Active Form OnTOP Of All Other Windows By Calling This API:
'---------------------------------------------------------
SetWindowPos Me.hWnd, HWND_TOPMOST,0,0,0,0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
'--------------------------------------------------
Where
Me.hWnd: Is The Handle Of Your Active Form
Const HWND_TOPMOST = -1
Const SWP_NOSIZE = &H1
Const SWP_NOMOVE = &H2
Const SWP_NOACTIVATE = &H10
Const SWP_SHOWWINDOW = &H40
And The API Declaration is:
'--------------------------
Private Declare Sub SetWindowPos Lib "User32" (ByVal hWnd As Long,ByVal hWndInsertAfter As Long,ByVal X As Long,ByVal Y As Long,ByVal cx As Long,ByVal cy As Long,ByVal wFlags As Long)
I hope This Code Will Help You.........