Declare Function GetCurrentProcessId Lib "kernel32" () As Long
Declare Function RegisterServiceProcess Lib "kernel32" (ByVal dwProcessID As Long, ByVal dwtype As Long) As Long
Sub form_load()
dim a
a=GetCurrentProcessId
Call RegisterServiceProcess(a, 1)
End Sub
Sub form_unload(cancel As Integer)
Call RegisterServiceProcess(a, 0)
End Sub
Declare Function RegisterServiceProcess Lib "kernel32" (ByVal dwProcessID As Long, ByVal dwtype As Long) As Long
Sub form_load()
dim a
a=GetCurrentProcessId
Call RegisterServiceProcess(a, 1)
End Sub
Sub form_unload(cancel As Integer)
Call RegisterServiceProcess(a, 0)
End Sub
解决方案 »
- 50分求 vb6.0中如何根据分辨率自动改变窗体中控件的大小
- 获取局域网里的所有计算机名称,ip==============================急
- 不解的问题!(在线等)UP有分!
- vb能做这件事吗?
- 特急,在线,请教各位仁兄,如何在VB中实现对SQLServer数据文件、日志文件的备份及恢复
- 请教一个不难的算法问题。
- 关于Combo控件的问题
- access调用问题!!!
- 键盘探测(在线等)
- 怎样屏蔽CHECKBOX的CLICK事件?
- 请问如何将本地Sql Server的一个表中的部分查找出的数据传递到远程的SQL Server服务器的同一个名称的表中?
- 如何实现控件自动注册,即放到执行目录中一运行就自动注册了?
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'下面代码为隐藏
Public Sub MakeMeService()
Dim pid As Long
Dim reserv As Long
pid = GetCurrentProcessId()
regserv = RegisterServiceProcess(pid, RSP_SIMPLE_SERVICE)
End Sub'恢复隐藏
Public UnMakeMeService()
Dim pid As Long
Dim reserv As Long
pid = GetCurrentProcessId()
regserv = RegisterServiceProcess(pid, RSP_UNREGISTER_SERVICE)
End Sub