RegisterServiceProcess

cs_hihello Messages postés 20 Date d'inscription samedi 7 mai 2005 Statut Membre Dernière intervention 25 août 2006 - 9 mars 2006 à 15:32
cs_Willi Messages postés 2375 Date d'inscription jeudi 12 juillet 2001 Statut Modérateur Dernière intervention 15 décembre 2018 - 9 mars 2006 à 19:38
j'utilise la fct API RegisterServiceProcess pour démarrer un service mais elle n'est pas compatible avec WIN XP.
il y'a une autre fct que je peut utiliser sous WIN XP ?
il y'a un autre code pour démarrer un service?
Voici le code utilisé (télécharger de vb france)
'Module service
Private Const RSP_SIMPLE_SERVICE = 1
Private Const RSP_UNREGISTER_SERVICE = 0

Private Declare Function GetCurrentProcessId Lib "kernel32.dll" () As Long
Private Declare Function GetCurrentProcess Lib "kernel32.dll" () As Long
Private Declare Function RegisterServiceProcess Lib "kernel32.dll" (ByVal _
dwProcessID As Long, ByVal dwType As Long) As Long
Public Sub MakeMeService()
Dim pid As Long
Dim regserv As Long

pid = GetCurrentProcessId()
regserv = RegisterServiceProcess(pid, RSP_SIMPLE_SERVICE)
End Sub
Public Sub UnMakeMeService()
Dim pid As Long
Dim regserv As Long

pid = GetCurrentProcessId()
regserv = RegisterServiceProcess(pid, RSP_UNREGISTER_SERVICE)
End Sub

'form
Private Sub Form_Load()
MakeMeService
End Sub

1 réponse

cs_Willi Messages postés 2375 Date d'inscription jeudi 12 juillet 2001 Statut Modérateur Dernière intervention 15 décembre 2018 22
9 mars 2006 à 19:38
Bonsoir,
Un petit tour sur google est http://www.andreavb.com/tip060002.html
0
Rejoignez-nous