![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
Join Date: Jan 2005
Posts: 110
Rep Power: 4
![]() |
installing service
hey i want to try installin a program as a service but i want it to work on a few windows versions (not just NT) XP 2000 and NT ive seen a couple of programs out there that can install but only for nt >_<
does anyone know a program that can install a service (a program that doesnt have a gui, a command line instead )or anyone know where i can find how to make one or any tips or if it would be to hard to make one seems as im a beginner ![]() please help me thanks alot ![]() |
|
|
|
|
|
#2 |
|
Expert Programmer
|
from MSDN:
Const RSP_SIMPLE_SERVICE = 1
Const RSP_UNREGISTER_SERVICE = 0
Private Declare Function GetCurrentProcessId Lib "kernel32" () As Long
Private Declare Function RegisterServiceProcess Lib "kernel32" (ByVal dwProcessID As Long, ByVal dwType As Long) As Long
Public Sub MakeMeService()
Dim pid As Long, reserv As Long
'Get the current process ID
pid = GetCurrentProcessId()
'Register as service
regserv = RegisterServiceProcess(pid, RSP_SIMPLE_SERVICE)
End Sub
Public Sub UnMakeMeService()
Dim pid As Long, reserv As Long
'Get the current process ID
pid = GetCurrentProcessId()
'Unregister as service
regserv = RegisterServiceProcess(pid, RSP_UNREGISTER_SERVICE)
End Sub
Private Sub Form_Load()
MakeMeService
End Sub
Private Sub Form_Unload(Cancel As Integer)
UnMakeMeService
End SubWill only work on versions of windows up to 2000 - not XP. For a fully working service EXE (automatic startup, start stop buttons etc) you'll need to google. Vb6 support for services in XP and on is defunct, as all services are now digitally signed and trusted etc. meaning you have to use VB.NET. Sorry! |
|
|
|
|
|
#3 |
|
Hobbyist Programmer
Join Date: Jan 2005
Posts: 110
Rep Power: 4
![]() |
thanks for the help again ^^
ill check google for some programs ![]() |
|
|
|
|
|
#4 |
|
Expert Programmer
|
No Problem!
If you can't find anything, you could always make your app sit in the system tray, if that's any help. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|