susn
Mar 8th, 2001, 01:36 PM
On my Win 98 System a Application of mine runs without Problems ....
[ /code]
Public Declare Function GetCurrentProcessId _
Lib "kernel32" () As Long
Public Declare Function GetCurrentProcess _
Lib "kernel32" () As Long
Public Declare Function RegisterServiceProcess _
Lib "kernel32" (ByVal dwProcessID As Long, _
ByVal dwType As Long) As Long
Public Const RSP_SIMPLE_SERVICE = 1
Public Const RSP_UNREGISTER_SERVICE = 0
'To remove your program from the Ctrl+Alt+Delete
'list call the MakeMeService procedure:
Public Sub MakeMeService()
Dim pid As Long
Dim regserv As Long
pid = GetCurrentProcessId()
regserv = RegisterServiceProcess(pid, RSP_SIMPLE_SERVICE)
End Sub
'To restore your application to the Ctrl+Alt+Delete list, call the UnMakeMeService procedure:
Public Sub UnMakeMeService()
Dim pid As Long
Dim regserv As Long
pid = GetCurrentProcessId()
regserv = RegisterServiceProcess(pid, RSP_UNREGISTER_SERVICE)
'End Code
'Dont forget to unregister your application as a
'service before it closes to free up system resources
'by calling UnMakeMeService.
End Sub
[ /code]
But on my Windows 2000 System it is impossible to run that Code.
How do i Register my Programm as a Service when running the Code on Windows NT or 2000?
Could anybody help to solve that?
Thx,
Susn
[ /code]
Public Declare Function GetCurrentProcessId _
Lib "kernel32" () As Long
Public Declare Function GetCurrentProcess _
Lib "kernel32" () As Long
Public Declare Function RegisterServiceProcess _
Lib "kernel32" (ByVal dwProcessID As Long, _
ByVal dwType As Long) As Long
Public Const RSP_SIMPLE_SERVICE = 1
Public Const RSP_UNREGISTER_SERVICE = 0
'To remove your program from the Ctrl+Alt+Delete
'list call the MakeMeService procedure:
Public Sub MakeMeService()
Dim pid As Long
Dim regserv As Long
pid = GetCurrentProcessId()
regserv = RegisterServiceProcess(pid, RSP_SIMPLE_SERVICE)
End Sub
'To restore your application to the Ctrl+Alt+Delete list, call the UnMakeMeService procedure:
Public Sub UnMakeMeService()
Dim pid As Long
Dim regserv As Long
pid = GetCurrentProcessId()
regserv = RegisterServiceProcess(pid, RSP_UNREGISTER_SERVICE)
'End Code
'Dont forget to unregister your application as a
'service before it closes to free up system resources
'by calling UnMakeMeService.
End Sub
[ /code]
But on my Windows 2000 System it is impossible to run that Code.
How do i Register my Programm as a Service when running the Code on Windows NT or 2000?
Could anybody help to solve that?
Thx,
Susn