VBGood网站全文搜索 Google

搜索VBGood全站网页(全文搜索)
首页 - 经验之谈 - 怎样将你的程序从 WIN 的系统任务列表中隐藏(即 CTRL+ALT+DEL 出来的框)
发表评论(0)作者:不详, 平台:VB6.0+Win98, 阅读:10356, 日期:2001-06-04
怎样将你的程序从 WIN  的系统任务列表中隐藏(即 CTRL+ALT+DEL 出来的框)

关键词:Visual Basic

rem 复制以下代码到 一模块中

Declarations
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
REM ==================
Procedures
REM 下面代码为隐藏

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

pid = GetCurrentProcessId()
regserv = RegisterServiceProcess(pid, RSP_SIMPLE_SERVICE)
End Sub
REM 恢复隐藏
Public UnMakeMeService()
Dim pid As Long
Dim reserv As Long

pid = GetCurrentProcessId()
regserv = RegisterServiceProcess(pid, _
RSP_UNREGISTER_SERVICE)
注释:End Code