Skip to content

Latest commit

 

History

History
77 lines (61 loc) · 3.59 KB

nf-shellapi-netaddr_getaddress.md

File metadata and controls

77 lines (61 loc) · 3.59 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:shellapi.NetAddr_GetAddress
NetAddr_GetAddress macro (shellapi.h)
Indicates whether a network address conforms to a specified type and format.
NetAddr_GetAddress
NetAddr_GetAddress macro [Windows Shell]
_shell_NetAddr_GetAddress
shell.NetAddr_GetAddress
shellapi/NetAddr_GetAddress
shell\NetAddr_GetAddress.htm
shell
2d0310a8-89ca-41b5-8afc-faec29bd23ba
12/05/2018
NetAddr_GetAddress, NetAddr_GetAddress macro [Windows Shell], _shell_NetAddr_GetAddress, shell.NetAddr_GetAddress, shellapi/NetAddr_GetAddress
shellapi.h
Windows
Windows Vista [desktop apps only]
Windows Server 2008 [desktop apps only]
Windows
19H1
NetAddr_GetAddress
shellapi/NetAddr_GetAddress
c++
APIRef
kbSyntax
HeaderDef
Shellapi.h
NetAddr_GetAddress

NetAddr_GetAddress macro

-description

Indicates whether a network address conforms to a specified type and format.

-parameters

-param hwnd

A handle to the network address control that contains the address to validate.

-param pv [in, out]

A pointer to an NC_ADDRESS structure to receive network address information in parsed form, if the address format and type in the control specified by hwnd are validated. The calling application is responsible for allocating the memory for this structure.

-remarks

Use the NetAddr_GetAddress macro to validate a network address in a network address control against a preset network address type mask. To instantiate, use the class msctls_netaddress defined in Shellapi.h. Call InitNetworkAddressControl at run time before calling this macro. This initializes the common controls library that contains the network address control.

This macro gets the network address string from a network address control, parses the string, and checks whether the string matches a network address type mask. If the string matches the mask, the function returns S_OK and returns the string in parsed form to the calling application (including the port number, prefix length, and other address information), using the NC_ADDRESS structure pointed to by pv. This macro returns E_INVALIDARG if the calling application fails to allocate the structure pointed to by pv.

Representations of Internet Protocol (IP) address versions 4 and 6 (v4/v6) for services and networks, as well as named Internet addresses and services using Domain Name System (DNS) format are parsed. If the network address string represents a named host name (DNS) or service, the value returned in the PrefixLength member of NC_ADDRESS is zero.

Set the network address type mask using the NetAddr_SetAllowType macro before you call the NetAddr_GetAddress macro.

-see-also

NetAddr_GetAllowType