Serviço para Windows
Posted: Fri Mar 02, 2007 11:33 am
E ae pessoa, alguem sabe como eu faço para criar um serviço no windows?
[]s!!
[]s!!
www.FiveTechSoft.com
https://forums.fivetechsoft.com/
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"
//----------------------------------------------------