网站首页  词典首页

请输入您要查询的函数:

 

术语 getservicedisplayname
释义 GetServiceDisplayName
语法:
C++
BOOL WINAPI GetServiceDisplayName(
__in SC_HANDLE hSCManager,
__in LPCTSTR lpServiceName,
__out_opt LPTSTR lpDisplayName,
__inout LPDWORD lpcchBuffer
);
GetServiceDisplayName功能
检索指定的服务显示名称。
参数
hSCManager [in]
一个句柄,服务控制管理数据库,由OpenSCManager函数返回。
lpServiceName [in]
服务名称。这个名称是该服务的注册表项的名称相同。最好是选择一个名称,少于256个字符。
lpDisplayName [指出,可选]
阿一个缓冲区,它接收服务的显示名称的指针。如果函数失败,这个缓冲区将包含一个空字符串。
这个数组的最大大小是4K字节。要确定所需的大小,指定此参数和lpcchBuffer参数0空。该函数将失败,而且GetLastError将返回ERROR_INSUFFICIENT_BUFFER。该lpcchBuffer参数将获得所需的大小。
此参数可以指定一个本地化的字符串使用下列格式:
@ [路径\\] dllnamedll文件名,- strID
与标识符strID加载字符串从dllnamedll文件名,路径是可选的。有关更多信息,请参阅RegLoadMUIString。
Windows Server 2003和Windows XP/2000操作系统:本地化字符串之前不支持Windows Vista的。
lpcchBuffer [ in , out ]
一个变量,它指定的缓冲区大小的指针指向lpDisplayName,在TCHARs。对产出,这个变量接收服务的显示名称大小字符,不包括空终止字符。
如果缓冲区指向lpDisplayName太小,无法遏制的显示名称,该函数不存储它。当函数返回时,lpcchBuffer包含服务的显示名称的大小,不包括空终止字符。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
有两个名字的服务:服务名称和显示名称。服务名称是该服务的注册表中的项名称。显示名称是一个用户友好的名称,在服务控制面板的应用出现,并与使用net start命令。为了服务名称映射到显示的名称,使用GetServiceDisplayName功能。要映射的显示名称,服务名称,使用GetServiceKeyName功能。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinsvc.h(头文件:winuser.h)
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode和ANSI namesGetServiceDisplayNameW(Unicode)和GetServiceDisplayNameA(ANSI)的
参见
GetServiceKeyName
OpenSCManager
服务函数
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==GetServiceDisplayName Function
Retrieves the display name of the specified service.
Syntax
C++
BOOL WINAPI GetServiceDisplayName(
__in SC_HANDLE hSCManager,
__in LPCTSTR lpServiceName,
__out_opt LPTSTR lpDisplayName,
__inout LPDWORD lpcchBuffer
);
Parameters
hSCManager [in]
A handle to the service control manager database, as returned by the OpenSCManager function.
lpServiceName [in]
The service name. This name is the same as the service's registry key name. It is best to choose a name that is less than 256 characters.
lpDisplayName [out, optional]
A pointer to a buffer that receives the service's display name. If the function fails, this buffer will contain an empty string.
The maximum size of this array is 4K bytes. To determine the required size, specify NULL for this parameter and 0 for the lpcchBuffer parameter. The function will fail and GetLastError will return ERROR_INSUFFICIENT_BUFFER. The lpcchBuffer parameter will receive the required size.
This parameter can specify a localized string using the following format:
@[path\\]dllname,-strID
The string with identifier strID is loaded from dllname; the path is optional. For more information, see RegLoadMUIString .
Windows Server 2003 and Windows XP/2000: Localized strings are not supported until Windows Vista.
lpcchBuffer [in, out]
A pointer to a variable that specifies the size of the buffer pointed to by lpDisplayName, in TCHARs. On output, this variable receives the size of the service's display name, in characters, excluding the null-terminating character.
If the buffer pointed to by lpDisplayName is too small to contain the display name, the function does not store it. When the function returns, lpcchBuffer contains the size of the service's display name, excluding the null-terminating character.
Return Value
If the functions succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
There are two names for a service: the service name and the display name. The service name is the name of the service's key in the registry. The display name is a user-friendly name that appears in the Services control panel application, and is used with the NET START command. To map the service name to the display name, use the GetServiceDisplayName function. To map the display name to the service name, use the GetServiceKeyName function.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinsvc.h (include Windows.h)
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode and ANSI namesGetServiceDisplayNameW (Unicode) and GetServiceDisplayNameA (ANSI)
See Also
GetServiceKeyName
OpenSCManager
Service Functions
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms683228(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:19:49