次の方法で共有


INetCfgComponentPropertyUi::ApplyProperties method

The ApplyProperties method directs the notify object of the network component to store, in memory, proposed changes for the component's network configuration state.

Syntax

HRESULT ApplyProperties(
   void 
);

Parameters

  • **
    None

Return value

Returns zero (S_OK) if successful, indicating that the proposed changes were applied, and returns S_FALSE if no changes were made. ApplyProperties can return NETCFG_* codes that are defined in Netcfgx.h.

Remarks

The network configuration subsystem calls ApplyProperties after a user clicks either OK or Apply on a custom property sheet. The ApplyProperties method stores the proposed changes in memory, but does not write the changes to the registry. Only the INetCfgComponentControl::ApplyRegistryChanges method makes changes permanent by writing them to the registry.

Note the following:

  • An individual custom property page loses focus as the user activates another page. As a page loses focus, it receives property sheet messages to apply changes. Each page's dialog box procedure processes these messages before the network configuration subsystem calls ApplyProperties. It is the responsibility of each individual property page to set the changed flag for the property sheet. Each page's dialog box procedure can call the PropSheet_Changed macro to set the property sheet's changed flag after the procedure receives a message for an event that causes a change to occur. In this call, the dialog box procedure passes handles to the property sheet and the page that has changed. To retrieve the handle to the property sheet, the procedure can call the Win32 GetParent function and pass the handle to the property page. The following example informs a property sheet that information in one of its pages has changed.

    PropSheet_Changed(GetParent(hWndPage), hWndPage) 
    

    For more information, see the documentation for property sheets in the Microsoft Windows SDK.

  • The network configuration subsystem must call the INetCfgComponentPropertyUi::ValidateProperties method before calling ApplyProperties.

  • If the INetCfg interface for the current networking configuration was not granted the write lock, the network configuration subsystem will not call ApplyProperties.

Requirements

Target platform

Desktop

Header

Netcfgn.h (include Netcfgn.h)

See also

INetCfg

INetCfgComponentControl::ApplyRegistryChanges

INetCfgComponentPropertyUi::ValidateProperties

 

 

Send comments about this topic to Microsoft