Using Win32 functions in Visual FoxPro Image Gallery
Service
..msdn
CloseServiceHandle
ControlService
CreateService
DeleteService
EnumServicesStatus
GetUserObjectInformation
LockServiceDatabase
OpenSCManager
OpenService
StartService
UnlockServiceDatabase
Code examples:
How to create a service object
CreateService
..msdn    Add comment     W32 Constants      Translate this page
Creates a service object and adds it to the specified service control manager database.
Code examples:
How to create a service object
Declaration:
SC_HANDLE WINAPI CreateService(
    SC_HANDLE hSCManager,
    LPCTSTR lpServiceName,
    LPCTSTR lpDisplayName,
    DWORD dwDesiredAccess,
    DWORD dwServiceType,
    DWORD dwStartType,
    DWORD dwErrorControl,
    LPCTSTR lpBinaryPathName,
    LPCTSTR lpLoadOrderGroup,
    LPDWORD lpdwTagId,
    LPCTSTR lpDependencies,
    LPCTSTR lpServiceStartName,
    LPCTSTR lpPassword
);
FoxPro declaration:
DECLARE INTEGER CreateService IN advapi32;
    INTEGER hSCManager,;
    STRING lpServiceName,;
    STRING lpDisplayName,;
    LONG dwDesiredAccess,;
    LONG dwServiceType,;
    LONG dwStartType,;
    LONG dwErrorControl,;
    STRING lpBinaryPathName,;
    STRING lpLoadOrderGroup,;
    LONG lpdwTagId,;
    STRING lpDependencies,;
    STRING lpServiceStartName,;
    STRING lpPassword
Parameters:
hSCManager
[in] Handle to the service control manager database. This handle is returned by the OpenSCManager function and must have the SC_MANAGER_CREATE_SERVICE access right.

lpServiceName
[in] Pointer to a null-terminated string that specifies the name of the service to install.

lpDisplayName
[in] Pointer to a null-terminated string that contains the display name to be used by user interface programs to identify the service.

dwDesiredAccess
[in] Access to the service.

dwServiceType
[in] Service types, example SERVICE_WIN32_OWN_PROCESS.

dwStartType
[in] Service start options, example SERVICE_DEMAND_START.

dwErrorControl
[in] Severity of the error, and action taken, if this service fails to start, example SERVICE_ERROR_NORMAL.

lpBinaryPathName
[in] Pointer to a null-terminated string that contains the fully qualified path to the service binary file.

lpLoadOrderGroup
[in] Pointer to a null-terminated string that names the load ordering group of which this service is a member. Can be NULL.

lpdwTagId
[out] Pointer to a variable that receives a tag value that is unique in the group specified in the lpLoadOrderGroup parameter. Can be NULL.

lpDependencies
[in] Pointer to a double null-terminated array of null-separated names of services or load ordering groups that the system must start before this service. Can be NULL.

lpServiceStartName
[in] Pointer to a null-terminated string that specifies the name of the account under which the service should run. Set to NULL for LocalSystem account.

lpPassword
[in] Pointer to a null-terminated string that contains the password to the account name specified by the lpServiceStartName parameter.
Return value:
If the function succeeds, the return value is a handle to the service.
My comment:
The returned handle is only valid for the process that called CreateService. It can be closed by calling the CloseServiceHandle function.
Word Index links for the CreateService :
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2006-09-21 21:49:26
Modified: 2006-09-21 21:55:07
Visited in last 7 days: 16
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.37), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.224.75.202)
6 sec.
Function group: 'Icon'
12 sec.Function: 'DeleteDC'
20 sec.Function: 'CeCreateDatabase'
28 sec.Function: 'CeRegCloseKey'
34 sec.
Function group: 'Time'
41 sec.Function: 'CeOpenDatabase'
48 sec.
Function group: 'GDI+ ImageAttributes'
53 sec.Function: 'GdipCreateFromHDC2'
58 sec.
Function group: 'Coordinate Space and Transformation'
1.05 min.
Function group: 'File Management'
Google
Advertise here!