Export (0) Print
Expand All

WNetDisconnectDialog function

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.

Syntax


DWORD WNetDisconnectDialog(
  _In_  HWND hwnd,
  _In_  DWORD dwType
);

Parameters

hwnd [in]

Handle to the owner window for the dialog box.

dwType [in]

Resource type to disconnect from. This parameter can have the following value.

ValueMeaning
RESOURCETYPE_DISK

Disconnects from disk resources.

 

Return value

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 is a system error code, such as one of the following values.

Return codeDescription
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

The WNetDisconnectDialog function returns immediately and creates a dialog box for disconnecting networked drives. This dialog box runs asynchronously on a worker thread.

If the worker thread is terminated, the owner window and its associated dialog box are also terminated. If this occurs, the user might not be able to interact with the dialog box, because it will not appear on the user's screen or will appear briefly.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Winnetwk.h

Library

Mpr.lib

DLL

Mpr.dll

See also

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

 

 

Community Additions

ADD
Show:
© 2014 Microsoft