Platform SDK: Windows Networking

WNetDisconnectDialog

The WNetDisconnectDialog function starts a general browsing dialog box for disconnecting from network resources. The function requires a handle to the owner window for the dialog box.

DWORD WNetDisconnectDialog(
  HWND hwnd,     // handle to window owning dialog box
  DWORD dwType   // resource type
);

Parameters

hwnd
[in] Specifies a handle to the owner window for the dialog box.
dwType
[in] Specifies the resource type to disconnect from. This parameter can have the following value.
Value Meaning
RESOURCETYPE_DISK Disconnects from disk resources.

Return Values

If the function succeeds, the return value is NO_ERROR. If the user cancels the dialog box, the return value is –1.

If the function fails, the return value can be one of the following error codes.

Value Meaning
ERROR_EXTENDED_ERROR A network-specific error occurred. To obtain a description of the error, call the WNetGetLastError function.
ERROR_NO_NETWORK The network is unavailable.
ERROR_NOT_ENOUGH_MEMORY There is insufficient memory to start the dialog box.

Remarks

If the user chooses OK in the dialog box, the requested network disconnection will have been made when the WNetDisconnectDialog function returns.

Requirements

  Windows NT/2000: Requires Windows NT 3.1 or later.
  Windows 95/98: Requires Windows 95 or later.
  Header: Declared in Winnetwk.h.
  Library: Use Mpr.lib.

See Also

Windows Networking (WNet) Overview, Windows Networking Functions, WNetAddConnection2, WNetCancelConnection2, WNetConnectionDialog, WNetConnectionDialog1