cs_hihello
Messages postés20Date d'inscriptionsamedi 7 mai 2005StatutMembreDernière intervention25 août 2006
-
9 mars 2006 à 15:32
cs_Willi
Messages postés2375Date d'inscriptionjeudi 12 juillet 2001StatutModérateurDernière intervention15 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