Hide program in Ctlr-Alt-Del list

If you press Ctrl-Alt-Del at the same time a listbox will appear and you can see all program that currently running in your computer, for some reasons may you want to hide your program from the list.

There's 2 method you can choose to do that;

The easiest way is by using the TaskVisible property of the App-object. If you set it to False, the task will be hiden from the CTRL-ALT-DEL-list. If you set it to True, your task will reappear again.

'Hide my program from list
App.TaskVisible = False
'Show on list
App.TaskVisible = True

Another way is by registering your program as a service. This is done by passing the process ID of your application to the RegisterService API.


Declarations
Copy the following code into the declarations section of a module:

Public Declare Function GetCurrentProcessId _
Lib "kernel32" () As Long
Public Declare Function GetCurrentProcess _
Lib "kernel32" () As Long
Public Declare Function RegisterServiceProcess _
Lib "kernel32" (ByVal dwProcessID As Long, _
ByVal dwType As Long) As Long

Public Const RSP_SIMPLE_SERVICE = 1
Public Const RSP_UNREGISTER_SERVICE = 0

'Declaration end here.

Procedures
To remove your program from the Ctrl+Alt+Delete list, call the MakeMeService procedure:

Public Sub MakeMeService()
Dim pid As Long
Dim reserv As Long

pid = GetCurrentProcessId()
regserv = RegisterServiceProcess(pid, RSP_SIMPLE_SERVICE)
End Sub

'procedure end here


To restore your application to the Ctrl+Alt+Delete list, call the UnMakeMeService procedure:

Public UnMakeMeService()
Dim pid As Long
Dim reserv As Long

pid = GetCurrentProcessId()
regserv = RegisterServiceProcess(pid, _
RSP_UNREGISTER_SERVICE)

'End Code


Don't forget to unregister your application as a service before it closes to free up system resources by calling UnMakeMeService.

Previous Post
Next Post
Related Posts