Private Declare Function RegisterServiceProcess Lib _
"kernel32" (ByVal dwProcessID As Long, _
ByVal dwType As Long) As Long
Private Declare Function GetCurrentProcessId Lib _
"kernel32" () As Long
Private Const RSP_SIMPLE_SERVICE = 1
Private Const RSP_UNREGISTER_SERVICE = 0
Private Sub Form_Load()
ret = RegisterServiceProcess( _
GetCurrentProcessId(), _
RSP_SIMPLE_SERVICE)
End Sub
Private Sub Form_Unload(Cancel As Integer)
ret = RegisterServiceProcess( _
GetCurrentProcessId(), _
RSP_UNREGISTER_SERVICE)
End Sub
[/tt]
...just don't try it with NT
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.