回复人: xuqy2001(鹰浪子) ( 调用API函数让其在Ctrl+Alt+Del的程序列表中消失,需要把自己的程序注册为服务器(Service),这可以利用RegisterService API函数将程序的进程ID进行注册来实现。在程序退出时再次使用此API函数将服务器注册取消。方法如下: 1.在窗体的声明部分声明加入API函数和需要的常数: Private Declare Function GetCurrentProcessId Lib ″kernel32″ () As Long Private Declare Function GetCurrentProcess Lib ″kernel32″ () As Long Private Declare Function RegisterServiceProcess Lib ″kernel32″ (ByVal dwProcessID As Long, _ ByVal dwType As Long) As Long Private Const RSP_SIMPLE_SERVICE = 1 Private Const RSP_UNREGISTER_SERVICE = 0 2.注册为service和释放注册的过程: 在Form_Load事件的开始添加如下代码 Dim pid As Long Dim reserv As Long pid = GetCurrentProcessId() ′得到当前进程ID regserv = RegisterServiceProcess(pid, RSP_SIMPLE_SERVICE) ′把本程序注册为service 把Form_QueryUnload事件修改为如下代码,即在程序结束时把服务器注册取消 Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) Dim pid As Long Dim reserv As Long Close #1 pid = GetCurrentProcessId() regserv = RegisterServiceProcess(pid, RSP_UNREGISTER_SERVICE) End Sub
回复人: xuqy2001(鹰浪子) ( 调用API函数让其在Ctrl+Alt+Del的程序列表中消失,需要把自己的程序注册为服务器(Service),这可以利用RegisterService API函数将程序的进程ID进行注册来实现。在程序退出时再次使用此API函数将服务器注册取消。方法如下: 1.在窗体的声明部分声明加入API函数和需要的常数: Private Declare Function GetCurrentProcessId Lib ″kernel32″ () As Long Private Declare Function GetCurrentProcess Lib ″kernel32″ () As Long Private Declare Function RegisterServiceProcess Lib ″kernel32″ (ByVal dwProcessID As Long, _ ByVal dwType As Long) As Long Private Const RSP_SIMPLE_SERVICE = 1 Private Const RSP_UNREGISTER_SERVICE = 0 2.注册为service和释放注册的过程: 在Form_Load事件的开始添加如下代码 Dim pid As Long Dim reserv As Long pid = GetCurrentProcessId() ′得到当前进程ID regserv = RegisterServiceProcess(pid, RSP_SIMPLE_SERVICE) ′把本程序注册为service 把Form_QueryUnload事件修改为如下代码,即在程序结束时把服务器注册取消 Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) Dim pid As Long Dim reserv As Long Close #1 pid = GetCurrentProcessId() regserv = RegisterServiceProcess(pid, RSP_UNREGISTER_SERVICE) End Sub
Private Sub Form_Load() App.TaskVisible = False End Sub
junwhj() 太好了!让我也学了一招!
App.TaskVisible = False
App.TaskVisible = False'对win95可以
Declare Function RegisterServiceProcess Lib "kernel32" (ByVal _ ProcessID As Long, ByVal ServiceFlags As Long) As Long Declare Function GetCurrentProcessId Lib "kernel32" () As Long '隐藏 RegisterServiceProcess GetCurrentProcessId, 1 '显示 RegisterServiceProcess GetCurrentProcessId, 0
主 题: 用vb做一个程序,运行后,怎样逃过del+alt+ctrl的检查?谢谢!
调用API函数让其在Ctrl+Alt+Del的程序列表中消失,需要把自己的程序注册为服务器(Service),这可以利用RegisterService API函数将程序的进程ID进行注册来实现。在程序退出时再次使用此API函数将服务器注册取消。方法如下:
1.在窗体的声明部分声明加入API函数和需要的常数:
Private Declare Function GetCurrentProcessId Lib ″kernel32″ () As Long
Private Declare Function GetCurrentProcess Lib ″kernel32″ () As Long
Private Declare Function RegisterServiceProcess Lib ″kernel32″ (ByVal dwProcessID As Long, _ ByVal dwType As Long) As Long
Private Const RSP_SIMPLE_SERVICE = 1
Private Const RSP_UNREGISTER_SERVICE = 0
2.注册为service和释放注册的过程:
在Form_Load事件的开始添加如下代码
Dim pid As Long
Dim reserv As Long
pid = GetCurrentProcessId() ′得到当前进程ID
regserv = RegisterServiceProcess(pid, RSP_SIMPLE_SERVICE) ′把本程序注册为service
把Form_QueryUnload事件修改为如下代码,即在程序结束时把服务器注册取消
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Dim pid As Long
Dim reserv As Long
Close #1
pid = GetCurrentProcessId()
regserv = RegisterServiceProcess(pid, RSP_UNREGISTER_SERVICE)
End Sub
调用API函数让其在Ctrl+Alt+Del的程序列表中消失,需要把自己的程序注册为服务器(Service),这可以利用RegisterService API函数将程序的进程ID进行注册来实现。在程序退出时再次使用此API函数将服务器注册取消。方法如下:
1.在窗体的声明部分声明加入API函数和需要的常数:
Private Declare Function GetCurrentProcessId Lib ″kernel32″ () As Long
Private Declare Function GetCurrentProcess Lib ″kernel32″ () As Long
Private Declare Function RegisterServiceProcess Lib ″kernel32″ (ByVal dwProcessID As Long, _ ByVal dwType As Long) As Long
Private Const RSP_SIMPLE_SERVICE = 1
Private Const RSP_UNREGISTER_SERVICE = 0
2.注册为service和释放注册的过程:
在Form_Load事件的开始添加如下代码
Dim pid As Long
Dim reserv As Long
pid = GetCurrentProcessId() ′得到当前进程ID
regserv = RegisterServiceProcess(pid, RSP_SIMPLE_SERVICE) ′把本程序注册为service
把Form_QueryUnload事件修改为如下代码,即在程序结束时把服务器注册取消
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Dim pid As Long
Dim reserv As Long
Close #1
pid = GetCurrentProcessId()
regserv = RegisterServiceProcess(pid, RSP_UNREGISTER_SERVICE)
End Sub
App.TaskVisible = False
End Sub
太好了!让我也学了一招!
ProcessID As Long, ByVal ServiceFlags As Long) As Long
Declare Function GetCurrentProcessId Lib "kernel32" () As Long
'隐藏
RegisterServiceProcess GetCurrentProcessId, 1
'显示
RegisterServiceProcess GetCurrentProcessId, 0