Compartilhar via


INetCfgComponent::SetDisplayName method

The SetDisplayName method assigns a name to a network component, and the network configuration subsystem displays this name in the properties dialog for a network connection.

Syntax

HRESULT SetDisplayName(
  [in] LPCWSTR pszwDisplayName
);

Parameters

  • pszwDisplayName [in]
    Pointer to a constant null-terminated string of 16-bit Unicode characters containing the display name of a network component.

Return value

Returns zero (S_OK) if successful; and returns E_NOTIMPL if the component is not a network card (that is, if the component is not a member of network class GUID_DEVCLASS_NET). SetDisplayName can also return NETCFG_* codes that are defined in Netcfgx.h.

Remarks

If the INetCfg interface for the current networking configuration was not granted the write lock, SetDisplayName returns NETCFG_E_NO_WRITE_LOCK.

SetDisplayName is only valid for components that are members of network class GUID_DEVCLASS_NET. SetDisplayName returns E_NOTIMPL if called for components of other types, including the following:

  • Transports represented by GUID_DEVCLASS_NETTRANS

  • Network services represented by GUID_DEVCLASS_NETSERVICE

  • Network clients represented by GUID_DEVCLASS_NETCLIENT

    Note  NetClient components are deprecated in Windows 8.1, Windows Server 2012 R2, and later.

     

Requirements

Target platform

Desktop

Header

Netcfgx.h (include Netcfgx.h)

See also

INetCfg

 

 

Send comments about this topic to Microsoft