Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


ID: 22829, Windows service Information 1.0

by Jonas Gunnarsson Email: guson@spray.se


A collection of function and links about retriving information and manage the Windows services.
Download Details
FTP  download also available
CDN Login Required to Download. (You will be redirected to the login page if you click on the Download Link)
To download this, you must have registered:
A free membership

For Delphi, Version 4.0  to 7.0 1121 downloads
Copyright: Open Source or other


Size: 8,873 bytes
Updated on Sun, 28 Nov 2004 09:25:57 GMT
Originally uploaded on Sun, 28 Nov 2004 09:16:31 GMT
SHA1 Hash: 8AFDB2C34F093F3AE552D9FFF4AC9995020BBC29
MD5 Hash: CA4A0DAA0D3080CD6C5F4A333DC0C48A

    Explore the files in this upload

Description
The unit(gWinServices.pas) define some functions to make it easy to manage the Windows services.
gWinServices.pas defines the folowing functions;
// Get start up type as string
function ServiceGetStartTypeAsString(
dwStartType: DWord): string;
function ServiceGetStartTypeAsShortString(
dwStartType: DWord): string;
// Get current status as string
function ServiceGetCurrentStateAsString(
dwCurrentState: DWord): string;
function ServiceGetCurrentStateAsShortString(
dwCurrentState: DWord): string;
// Get a display name list of installed services
function ServiceGetDisplayNameList(
sMachine: string;
dwServiceType: DWord;
dwServiceState: DWord;
slServicesList: TStrings): Boolean;
// Get a service name list of installed services
function ServiceGetServiceNameList(
sMachine: string;
dwServiceType: DWord;
dwServiceState: DWord;
slServicesList: TStrings): Boolean;
// Get display name from service name
function ServiceGetDisplayName(
sMachine: string;
sServiceName: string;
var sDisplayName: string): Boolean;
// Get service name from display name
function ServiceGetServiceName(
sMachine: string;
sDisplayName: string;
var sServiceName: string): Boolean;
// Check the status of a service
function ServiceGetStatus(
sMachine: string;
sServiceName: string;
var dwCurrentState: DWord): Boolean;
// Get a dependent display name list of a running service
function ServiceGetDependentDisplayNameList(
sMachine: string;
sServiceName: string;
dwServiceState: DWord;
slServicesList: TStrings): Boolean;
// Get a dependent service name list of a running service
function ServiceGetDependentServiceNameList(
sMachine: string;
sServiceName: string;
dwServiceState: DWord;
slServicesList: TStrings): Boolean;
// Start a service
function ServiceStart(
sMachine: string;
sServiceName: string;
WaitForDesiredState: Boolean = True): Boolean;
// Stop a service
function ServiceStop(
sMachine: string;
sServiceName: string;
WaitForDesiredState: Boolean = True): Boolean;
// Pause a service
function ServicePause(
sMachine: string;
sServiceName: string;
WaitForDesiredState: Boolean = True): Boolean;
// Resume a service
function ServiceContinue(
sMachine: string;
sServiceName: string;
WaitForDesiredState: Boolean = True): Boolean;
// Restart a service
function ServiceRestart(
sMachine: string;
sServiceName: string;
WaitForDesiredState: Boolean = True): Boolean;
// Get the start up type for service
function ServiceGetStartType(
sMachine: string;
sServiceName: string;
var dwStartType: DWord): Boolean;
// Set the start up type for service
function ServiceSetStartType(
sMachine: string;
sServiceName: string;
dwStartType: DWord): Boolean;
// Get the service description
function ServiceGetDescription(
sMachine: string;
sServiceName: string;
var sDescription: string): Boolean;
How to use see example code, WindowsServices.pas.
The definition of the QueryServiceConfig2 and ChangeServiceConfig2 see, gWinSrv.pas
Known problems:
Need to check the "CanPauseAndContinue" to determen if a service can be paused.
Don't hesitate to send comments to .
Attachment for "Windows service Information 1.0":
gWinSvc.pas
gWinServices.pas
WindowsServices.dfm
WindowsServices.pas
WinSvcInfo.dpr

   Latest Comments  View All Add New

Move mouse over comment to see the full text

Could not retrieve comments. Please try again later.

Server Response from: ETNACDC04