Platform SDK: Windows Networking

CONNECTDLGSTRUCT

The CONNECTDLGSTRUCT structure is used by the WNetConnectionDialog1 function to establish browsing dialog box parameters.

typedef struct {
    DWORD cbStructure;
    HWND hwndOwner;
    LPNETRESOURCE lpConnRes;
    DWORD dwFlags;
    DWORD dwDevNum;
} CONNECTDLGSTRUCT, *LPCONNECTDLGSTRUCT;

Members

cbStructure
Specifies, in bytes, the size of the CONNECTDLGSTRUCT structure. The caller must supply this value.
hwndOwner
Specifies a handle to the owner window for the dialog box.
lpConnRes
Pointer to a NETRESOURCE structure.

If the lpRemoteName member of NETRESOURCE is specified, it will be entered into the path field of the dialog box. With the exception of the dwType member, all other members of the NETRESOURCE structure must be set to NULL. The dwType member must be equal to RESOURCETYPE_DISK.
Windows NT/2000: The system does not support the RESOURCETYPE_PRINT flag for browsing and connecting to print resources.

dwFlags
Specifies a DWORD value that contains a set of bit flags describing variations in the dialog box display. This member can be a combination of the following values.
Value Meaning
SidTypeUser The account is a user account.
CONNDLG_RO_PATH Display a read-only path instead of allowing the user to type in a path.

This flag should be set only if the lpRemoteName member of the NETRESOURCE structure pointed to by lpConnRes is not NULL (or an empty string), and the CONNDLG_USE_MRU flag is not set.

CONNDLG_CONN_POINT Internal flag. Do not use.
CONNDLG_USE_MRU Enter the most recently used paths into the combination box. Set this value to simulate the WNetConnectionDialog function.
CONNDLG_HIDE_BOX Show the check box allowing the user to restore the connection at logon.
CONNDLG_PERSIST Restore the connection at logon.
CONNDLG_NOT_PERSIST Do not restore the connection at logon.

For more information, see the following Remarks section.

dwDevNum
If the call to the WNetConnectionDialog1 function is successful, this member returns the number of the connected device. The value is 1 for A:, 2 for B:, 3 for C:, and so on. If the user made a deviceless connection, the value is –1.

Remarks

If neither the CONNDLG_RO_PATH nor the CONNDLG_USE_MRU flag is set, and the lpRemoteName member of the NETRESOURCE structure does not specify a remote path, the request defaults to the CONNDLG_RO_PATH dialog display type.

The CONNDLG_PERSIST and CONNDLG_NOT_PERSIST values cannot both be set. If neither is set, the dialog box defaults to the last option that was selected in this dialog box for the particular type of device connection.

Requirements

  Windows NT/2000: Requires Windows NT 4.0 or later.
  Windows 95/98: Requires Windows 95 or later.
  Header: Declared in Winnetwk.h.
  Unicode: Declared as Unicode and ANSI structures.

See Also

Windows Networking (WNet) Overview, Windows Networking Structures, NETRESOURCE, WNetConnectionDialog1