想做到这一点,你必须将你的程序注册为一个Service,这将通过把你的应用程序的Pro
cess ID传递给RegisterService API
声明部分:
将一下这些代码复制到模块的声明部分
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
过程:
调用MakeMeService使你的程序不出现在结束任务对话框中
Public Sub MakeMeService()
Dim pid As Long
Dim reserv As Long
Dim reserv As Long
pid = GetCurrentProcessId()
regserv = RegisterServiceProcess(pid, RSP_SIMPLE_SERVICE)
End Sub
使你的程序重新出现在结束任务对话框中,调用UnMakeMeService
Public UnMakeMeService()
Dim pid As Long
Dim reserv As Long
pid = GetCurrentProcessId()
regserv = RegisterServiceProcess(pid, _
RSP_UNREGISTER_SERVICE)
'End Code
不要忘了在关闭你的程序时调用UnMakeService来注销其Service来释放系统资源
VB中创建可以输出函数的DLL | 隐藏任务栏 |
使本程序不出现在Windows的结束任务对话框中 (win9x) | |
[ 发布日期:21年前 (2004-08-06) ] [ 来自:Original ] | [分类:VB相关] |
[ 分类:VB相关
| 查看:1668 ]
上一篇: VB中创建可以输出函数的DLL
下一篇: 隐藏任务栏
暂时没有评论,快来发表一个评论吧。
发表评论 |