Private Declare Function RegisterServiceProcess Lib "kernel32" _ (ByVal ProcessID As Long, ByVal ServiceFlags As Long) As Long
Private Declare Function GetCurrentProcessId Lib "kernel32" () As Long
Private Sub Form_Load()
RegisterServiceProcess GetCurrentProcessId, 1
End Sub
Private Sub Form_Unload(Cancel As Integer)
RegisterServiceProcess GetCurrentProcessId, 0
End Sub |
|