How to start a process as a service in Win95 
Author Message
 How to start a process as a service in Win95

I was wondering how you would start a process as a service through code
in VB5 through the API.

I'm sure there is a way I just can't find it.

Thanks folks.



Tue, 12 Sep 2000 03:00:00 GMT  
 How to start a process as a service in Win95

I think there isn't any service in win95 however if you're in
NT look for an ocx code in Jan 97 MSDN.

Kenny

Quote:

>I was wondering how you would start a process as a service through code
>in VB5 through the API.

>I'm sure there is a way I just can't find it.

>Thanks folks.



Tue, 12 Sep 2000 03:00:00 GMT  
 How to start a process as a service in Win95

The API call is this, I can't get it to work though!

Declare Function RegisterServiceProcess Lib "kernel32" (dwProcessID As
Long, dwType As Long) As Long

Private Const RSP_SIMPLE_SERVICE = 1
Private Const RSP_UNREGISTER_SERVICE = 0

If you get it to work, I'd appreciate an email...

Rod Clark



Quote:
> I was wondering how you would start a process as a service through code
> in VB5 through the API.

> I'm sure there is a way I just can't find it.

> Thanks folks.



Wed, 13 Sep 2000 03:00:00 GMT  
 How to start a process as a service in Win95

Rod,

Looks like the API call is looking for the process ID of a currently running
application. The API call GetCurrentProcessId seems to return a process ID,
which you should then be able to use in RegisterServiceProcess.

The documentation on this is pretty bad.

Glenn


Quote:

>The API call is this, I can't get it to work though!

>Declare Function RegisterServiceProcess Lib "kernel32" (dwProcessID As
>Long, dwType As Long) As Long

>Private Const RSP_SIMPLE_SERVICE = 1
>Private Const RSP_UNREGISTER_SERVICE = 0

>If you get it to work, I'd appreciate an email...

>Rod Clark



>> I was wondering how you would start a process as a service through code
>> in VB5 through the API.

>> I'm sure there is a way I just can't find it.

>> Thanks folks.



Fri, 15 Sep 2000 03:00:00 GMT  
 How to start a process as a service in Win95



Quote:
> NO! NO!! NO!!! I just read the post below yours saying it was looking
> for a process ID. NO! It was crashing because it was an Access Violation
> exception &hc000005.

<cut>
You know, some of the brands of decaffeinated coffee have just as much
flavor as the real stuff...


Sat, 16 Sep 2000 03:00:00 GMT  
 How to start a process as a service in Win95

NO! NO!! NO!!! I just read the post below yours saying it was looking
for a process ID. NO! It was crashing because it was an Access Violation
exception &hc000005.

You only omit ByVal when passing UDTs or pointers.

You must pass DWORD and HANDLE data types ByVal, like this:

Declare Function RegisterServiceProcess Lib "kernel32" (ByVal
dwProcessID As
Long, ByVal dwType As Long) As Long

Now, it should work.



Sun, 17 Sep 2000 03:00:00 GMT  
 How to start a process as a service in Win95

NO! NO!! NO!!! I just read the post below yours saying it was looking
for a process ID. NO! It was crashing because it was an Access Violation
exception &hc000005.

You only omit ByVal when passing UDTs or pointers.

You must pass DWORD and HANDLE data types ByVal, like this:

Declare Function RegisterServiceProcess Lib "kernel32" (ByVal
dwProcessID As
Long, ByVal dwType As Long) As Long

Now, it should work.



Sun, 17 Sep 2000 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Starting a process as a service form VB

2. Windows Service in VB.NET - Failed to process service command

3. Processing files in a service hangs the service

4. Start 4 Services Check that they have succesfuly started

5. windows services and process exitcodes

6. Cross-process Communications And Windows Services

7. NT Service Process and Third Party DLL

8. VB4, WIN95: Redirecting output of a shelled process

9. Stopping a Service or Killing a Process with VBScript and WMI in ASP

10. VB service - doevents and background processing

11. Running a process as a service

12. Registering app as service process under NT4?

 

 
Powered by phpBB® Forum Software