WORD WNetConnectionDialog(hwndParent, iType) | |||
HWND hwndParent; | |||
WORD iType; |
The WNetConnectionDialog function displays the dialog box used to both connecting and disconnecting devices.
hwndParent
Identifies the owner of the dialog box.
iType
Specifies the type of device to be connected. The parameter can be one of the following values.
Value | Meaning |
WNTYPE_DRIVE (0x0001) | A disk device. |
WNTYPE_FILE (0x0002) | A file. |
WNTYPE_PRINTER (0x0003) | A printer device. |
WNTYPE_COMM (0x0004) | A communications port. Reserved; do not use. |
The return value is one of the following values.
Value | Meaning |
WN_CANCEL | User cancelled (no new drives). |
WN_NOT_SUPPORTED | Function not supported. |
WN_OUT_OF_MEMORY | Not enough memory to display the dialog. |
WN_SUCCESS | Success. |
The export ordinal for this function is 27.
The difference between this function and the WNetConnectDialog and WNetDisconnectDialog functions is seen in the interfaces of Control Panel and File Manager. Control Panel's Printer Setup dialog box contains a Network button which displays the connection dialog box which may be used to both create and delete network connections.
For Windows 3.1, File Manager calls WNetConnectDialog and WNetDisconnectDialog for disks, and Control Panel calls WNetConnectionDialog for printers. The network driver should nonetheless check the iType parameter in case one or the other component is redesigned. (The network driver does not need to implement support for both types of devices in both dialogs; a capability bit will be reserved for indicating support for additional device types).
If the driver returns WN_NOT_SUPPORTED, File Manager carries out the same default operations as it would if the driver did not have the capability bit set for this dialog box.