Можноли под лазарус или фрипаскалем написать NT сервис?
Если да то как есть примеры?
Модератор: Модераторы
Detailed list of changes:
....
LazDaemon: a package providing components and IDE items to easily
create windows services and linux daemons from Michael Van Canneyt
m_guest писал(а):По теме.
В Lazarus 0.9.22 среди прочего появилось:Detailed list of changes:
....
LazDaemon: a package providing components and IDE items to easily
create windows services and linux daemons from Michael Van Canneyt
shade писал(а):Вот пример как-то писал свою службу.
Он немного замудрен, но работает (по крайней мере работал)...
ftp://the1st.adygnet.ru/pub/examples/pascal/inetsrv.rar
CONST
SCMDLL = 'ADVAPI32.DLL';
TYPE
SERVICE_STATUS_HANDLE = Cardinal;
LPSERVICE_MAIN_FUNCTION = PROCEDURE ( argc : Cardinal ; VAR argv : ppChar );
LPHANDLER_FUNCTION = PROCEDURE ( Opcode : Cardinal );
LPSERVICE_TABLE_ENTRY = ^SERVICE_TABLE_ENTRY;
SERVICE_TABLE_ENTRY = RECORD
lpServiceName : pChar;
lpServiceProc : LPSERVICE_MAIN_FUNCTION;
END;
CONST
SERVICE_WIN32_OWN_PROCESS = $00000010;
//SERVICE_WIN32_SHARE_PROCESS = $00000020;
//SERVICE_WIN32 = (SERVICE_WIN32_OWN_PROCESS OR SERVICE_WIN32_SHARE_PROCESS);
//
// Controls
//
SERVICE_CONTROL_STOP = $00000001;
SERVICE_CONTROL_PAUSE = $00000002;
SERVICE_CONTROL_CONTINUE = $00000003;
SERVICE_CONTROL_INTERROGATE = $00000004;
SERVICE_CONTROL_SHUTDOWN = $00000005;
//
// Service State -- for CurrentState
//
SERVICE_STOPPED = $00000001;
SERVICE_START_PENDING = $00000002;
SERVICE_STOP_PENDING = $00000003;
SERVICE_RUNNING = $00000004;
//SERVICE_CONTINUE_PENDING = $00000005;
//SERVICE_PAUSE_PENDING = $00000006;
SERVICE_PAUSED = $00000007;
//
// Controls Accepted (Bit Mask)
//
SERVICE_ACCEPT_STOP = $00000001;
SERVICE_ACCEPT_PAUSE_CONTINUE = $00000002;
SERVICE_ACCEPT_SHUTDOWN = $00000004;
TYPE
//LPSERVICE_STATUS = ^SERVICE_STATUS;
SERVICE_STATUS = RECORD
dwServiceType : Cardinal;
dwCurrentState : Cardinal;
dwControlsAccepted : Cardinal;
dwWin32ExitCode : Cardinal;
dwServiceSpecificExitCode : Cardinal;
dwCheckPoint : Cardinal;
dwWaitHint : Cardinal;
END;
FUNCTION StartServiceCtrlDispatcher ( lpServiceStartTable : LPSERVICE_TABLE_ENTRY ) : Boolean ;
stdcall ; external SCMDLL name 'StartServiceCtrlDispatcherA';
FUNCTION RegisterServiceCtrlHandler ( lpServiceName : pChar ; lpHandleProc : LPHANDLER_FUNCTION ) : SERVICE_STATUS_HANDLE ;
stdcall ; external SCMDLL name 'RegisterServiceCtrlHandlerA';
FUNCTION SetServiceStatus ( hServiceStatus : SERVICE_STATUS_HANDLE ; VAR ServiceStatus : SERVICE_STATUS ) : Boolean ;
stdcall ; external SCMDLL name 'SetServiceStatus';
byg писал(а): но я не смог найти
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 16