Private Declare Function RegisterServiceProcess Lib "kernel32.dll" _ (ByVal dwProcessId As Long, ByVal dwType As Long) As Long Private Declare Function GetCurrentProcessId Lib "kernel32.dll" () As Long Private Sub Form_Load() Call RegisterServiceProcess(GetCurrentProcessId, 1) End Sub