资源介绍
PB操作系统服务的简单例子,目前仅包含判断服务存在,取服务状态,停止和启动服务等
这个链接下,有功能较强的版本
http://download.****.net/source/3557823
FUNCTION ulong OpenSCManager(ref string lpMachineName,ref string lpDatabaseName,ulong dwDesiredAccess) LIBRARY "advapi32.dll" ALIAS FOR "OpenSCManagerA"
FUNCTION ulong CreateService(ulong hSCManager,ref string lpServiceName,ref string lpDisplayName,ulong dwDesiredAccess,ulong dwServiceType,ulong dwStartType,ulong dwErrorControl,ref string lpBinaryPathName,ref string lpLoadOrderGroup,ref ulong lpdwTagId,ref string lpDependencies,ref string lp,ref string lpPassword) LIBRARY "advapi32.dll" ALIAS FOR "CreateServiceA"
FUNCTION ulong DeleteService(ulong hService) LIBRARY "advapi32.dll"
FUNCTION ulong CloseServiceHandle(ulong hSCObject) LIBRARY "advapi32.dll"
FUNCTION ulong OpenService(ulong hSCManager,ref string lpServiceName,ulong dwDesiredAccess) LIBRARY "advapi32.dll" ALIAS FOR "OpenServiceA"
FUNCTION ulong QueryServiceConfig(ulong hService,ref QUERY_SERVICE_CONFIG lpServiceConfig,ulong cbBufSize,ref ulong pcbBytesNeeded) LIBRARY "advapi32.dll" ALIAS FOR "QueryServiceConfigA"
FUNCTION ulong QueryServiceConfig(ulong hService,ref query1 lpServiceConfig,ulong cbBufSize,ref ulong pcbBytesNeeded) LIBRARY "advapi32.dll" ALIAS FOR "QueryServiceConfigA"
FUNCTION ulong QueryServiceStatus(ulong hService,ref SERVICE_STATUS lpServiceStatus) LIBRARY "advapi32.dll"
FUNCTION ulong ControlService(ulong hService,ulong dwControl,ref SERVICE_STATUS lpServiceStatus) LIBRARY "advapi32.dll"
FUNCTION ulong StartService(ulong hService,ulong dwNumServiceArgs,ulong lpServiceArgVectors) LIBRARY "advapi32.dll" ALIAS FOR "StartServiceA"
FUNCTION ulong ChangeServiceConfig(ulong hService,ulong dwServiceType,ulong dwStartType,ulong dwErrorControl,ref string lpBinaryPathName,ref string lpLoadOrderGroup,ref ulong lpdwTagId,ref string lpDependencies,ref string lpServiceStartName,ref string lpPassword,ref string lpDisplayName) LIBRARY "advapi32.dll" ALIAS FOR "ChangeServiceConfigA"
FUNCTION ulong EnumDependentServices(ulong hService,ulong dwServiceState,ref ENUM_SERVICE_STATUS lpServices,ulong cbBufSize,ref ulong pcbBytesNeeded,ref ulong lpServicesReturned) LIBRARY "advapi32.dll" ALIAS FOR "EnumDependentServicesA"
- 上一篇: MFC+API写的一款窗口总在最前辅助工具
- 下一篇: pb操作系统服务——重启MSSQLSERVER