The easiest way to hide a program's running is to set the form's Visible to False. But just use Ctrl+Alt+Del to call out the program list and it will be completely exposed. So how to completely hide the running program? Actually very simple.
We know that there are many programs running in the background. However, only a part appears in the program list, and most system programs do not appear. In fact, processes registered as "server" will not appear in the program list.
API functions used:Hot Network
Private Declare Function GetCurrentProcessId Lib "kernel32" Alias "GetCurrentProcessId" () As Long
This function can obtain a unique identifier for the current process.
Private Declare Function RegisterServiceProcess Lib "kernel32" (ByVal dwProcessID As Long, ByVal dwType As Long) As Long
This function can register or unregister a process with a process ID number dwProcessID as a "server".
Constants used:
The constant here is the value of dwType.
Const RSP_SIMPLE_SERVICE = 1
Register as "Server".
Const RSP_UNREGISTER_SERVICE = 0
Cancel the "Server" registration.
program:
Public Sub MakeMeService()
Dim pid As Long, reserv As Long
'Get the current process ID
pid = GetCurrentProcessId()
'Register as a server
regserv = RegisterServiceProcess(pid, RSP_SIMPLE_SERVICE)
End Sub
Public Sub UnMakeMeService()
Dim pid As Long, reserv As Long
'Get the current process ID
pid = GetCurrentProcessId()
'Cancel server registrationHot Network
regserv = RegisterServiceProcess(pid, RSP_UNREGISTER_SERVICE)
End Sub
However, using this method cannot ensure that the program will not be found during running. If you use Program Hunter, you can find it out.