Using Win32 functions in Visual FoxPro Image Gallery
Service
..msdn
CloseServiceHandle
ControlService
CreateService
DeleteService
EnumServicesStatus
GetUserObjectInformation
LockServiceDatabase
OpenSCManager
OpenService
StartService
UnlockServiceDatabase
Code examples:
Encapsulating access to the Windows Services in a class
EnumServicesStatus
..msdn    Add comment     W32 Constants      Translate this page
The EnumServicesStatus function enumerates services in the specified service control manager database.
Code examples:
Encapsulating access to the Windows Services in a class
Declaration:
BOOL EnumServicesStatus(
  SC_HANDLE hSCManager,
  DWORD dwServiceType,
  DWORD dwServiceState,
  LPENUM_SERVICE_STATUS lpServices,
  DWORD cbBufSize,
  LPDWORD pcbBytesNeeded,
  LPDWORD lpServicesReturned,
  LPDWORD lpResumeHandle
);
FoxPro declaration:
DECLARE INTEGER EnumServicesStatus IN advapi32;
    INTEGER hSCManager,;
    LONG    dwServiceType,;
    LONG    dwServiceState,;
    INTEGER lpServices,;
    LONG    cbBufSize,;
    LONG  @ pcbBytesNeeded,;
    LONG  @ lpServicesReturned,;
    LONG  @ lpResumeHandle

Parameters:
hSCManager
[in] Handle to the service control manager database.

dwServiceType
[in] Type of services to enumerate.

dwServiceState
[in] State of the services to be enumerated.

lpServices
[out] Pointer to a buffer that contains an array of ENUM_SERVICE_STATUS structures that receive the name and service status information for each service in the database.

cbBufSize
[in] Size of the buffer pointed to by the lpServices parameter, in bytes.

pcbBytesNeeded
[out] Pointer to a variable that receives the number of bytes needed to return the remaining service entries, if the buffer is too small.

lpServicesReturned
[out] Pointer to a variable that receives the number of service entries returned.

lpResumeHandle
[in, out] Pointer to a variable that, on input, specifies the starting point of enumeration.
Return value:
If the function succeeds, the return value is nonzero.
My comment:
The hSCManager handle is returned by the OpenSCManager function, and must have the SC_MANAGER_ENUMERATE_SERVICE access right.

Set the value of lpResumeHandle to zero the first time this function is called.
Word Index links for the EnumServicesStatus :
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2004-12-14 21:58:00
Modified: 2004-12-14 22:02:29
Visited in last 7 days: 17
User Contributed Notes:
There are no notes on this subject.


Copyright 2001-2017 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.6.38), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.166.232.243)
14 sec.Function: 'ResetEvent'
26 sec.Function: 'Shell_GetImageLists'
41 sec.Function: 'DisconnectNamedPipe'
53 sec.Function: 'UrlEscape'
1.07 min.Function: 'SQLDataSources'
1.28 min.Function: 'JetRollback'
1.53 min.Function: 'QueryDosDevice'
1.77 min.Function: 'GetKeyboardLayoutName'
1.97 min.Function: 'AllocConsole'
2.17 min.Function: 'waveInGetDevCaps'
Google
Advertise here!