Platform SDK: Windows Networking |
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 );
Value | Meaning |
---|---|
RESOURCETYPE_DISK | Disconnects from disk resources. |
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. |
If the user chooses OK in the dialog box, the requested network disconnection will have been made when the WNetDisconnectDialog function returns.
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.
Windows Networking (WNet) Overview, Windows Networking Functions, WNetAddConnection2, WNetCancelConnection2, WNetConnectionDialog, WNetConnectionDialog1