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


    wParam = (WPARAM) (PNC_ADDRESS) pv;

    lParam = 0;            




Must be zero.

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.

Return value

Returns one of the following values of type HRESULT.

Return code Description
The calling application failed to allocate a NC_ADDRESS structure.
The out buffer is too small to hold the parsed network address.
The network address string is not of any type specified.
The operation was successful.
There is no address in the network address control to validate.



Use the NCM_GETADDRESS message 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 sending this message. This initializes the common controls library that contains the network address control.

This message 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 message 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 message 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 NCM_SETALLOWTYPE message before you send the NCM_GETADDRESS macro.


Requirement Value
Minimum supported client
Windows Vista [desktop apps only]
Minimum supported server
Windows Server 2008 [desktop apps only]

See also