The simplest way to hide a program is to set the Visible of the form to False. However, you only need to use Ctrl + Alt + Del to call out the program list. So how can we completely hide the running program? It is actually very simple.
We know that there are many programs running in the background. However, most system programs do not appear in the program list. In fact, processes registered as "servers" will not appear in the program list.
API functions used: Hotspot Network
Private Declare Function GetCurrentProcessId Lib "kernel32" Alias "GetCurrentProcessId" () As Long
This function obtains a unique identifier of the current process.
Private Declare Function RegisterServiceProcess Lib "kernel32" (ByVal dwProcessID As Long, ByVal dwType As Long) As Long
This function can be used to register a process whose process ID is dwProcessID or cancel registration as a "server ".
Constants used:
The constant here is the value of dwType.
Const RSP_SIMPLE_SERVICE = 1
Register as a "server ".
Const RSP_UNREGISTER_SERVICE = 0
Cancel "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 the Server Registration hotspot Network
Regserv = RegisterServiceProcess (pid, RSP_UNREGISTER_SERVICE)
End Sub
However, using this method cannot ensure that the program is not found during the running of the program, such as it can be found by a program hunter.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.