Saludos.
Alguien sabe como hacer para que un prg funcione como un servicio de windows....?
Programa tipo Servicio de Windows
- Maurilio Viana
- Posts: 252
- Joined: Tue Oct 25, 2005 2:48 pm
- Location: Garça/Garza/Heron City - Brazil
- Contact:
Intenta esto:
Pienso que tal vez no funcione con FW/Clipper, solamente con FW/[x]Harbour...
Saludos
Maurilio
Code: Select all
#include "FiveWin.ch"
//-------------------------
Function Main()
//-------------------------
ServiceProcess(1)
---- Tu codigo aqui
Return NIL
//------------------------------
Function ServiceProcess( mode )
//------------------------------
Local nProcessId := 0
Default mode := 0
nProcessId := GCP( )
If Abs( nProcessId ) > 0
RSProcess( nProcessId, mode )
Endif
RETURN
//----------------------------------------------------
DLL32 FUNCTION RSProcess(npID AS LONG ,;
nMode AS LONG ) AS LONG ;
FROM "RegisterServiceProcess" LIB "kernel32.DLL"
//----------------------------------------------------
//----------------------------------------------------
DLL32 FUNCTION GCP() AS LONG;
FROM "GetCurrentProcessId" LIB "kernel32.dll"
//----------------------------------------------------
Saludos
Maurilio
Hi Maurilio,Maurilio Viana wrote:Intenta esto:
Pienso que tal vez no funcione con FW/Clipper, solamente con FW/[x]Harbour...
I have 2 question:
1) is possible to run and stop the service with the normal windows interface?
2) also an MT program (only console) is possible transform into a service?
Thank you,
Ciao, best regards,
Ugo
Ugo