The CONNECTDLGSTRUCT data structure is used in the WNetConnectionDialog1 function to specify the browsing dialog box parameters.
typedef struct { DWORD cbStructure; HWND hwndOwner; LPNETRESOURCE lpConnRes; DWORD dwFlags; DWORD dwDevNum; } CONNECTDLGSTRUCT, *LPCONNECTDLGSTRUCT;
Value |
Meaning |
SidTypeUser |
The account is a user account. |
CONNDLG_RO_PATH |
Instead of allowing the user to type in a path, have a read-only path already inserted. This flag should be set only if lpRemoteName is not NULL (or an empty string), and CONNDLG_USE_MRU is not set. |
CONNDLG_CONN_POINT |
Internal flag. Do not use. |
CONNDLG_USE_MRU |
Enter the most recently used paths into the combo box. |
CONNDLG_HIDE_BOX |
Show the check box allowing the user to restore the connection at logon. |
CONNDLG_PERSIST |
Set if the connection is to be restored at logon. |
CONNDLG_NOT_PERSIST |
Set if the connection is not to be restored at logon. |
The function returns WN_SUCCESS if the call is successful and brings up the dialog. Typically this function will return an error only if the dialog box could not be displayed because errors that occur thereafter are reported to the user directly. If the call is successful, dwDevNum contains the number of the device connected to. If the user cancels the dialog box, the function returns 0xFFFFFFFF.
Error codes include one of the following.
Value |
Meaning |
WN_BAD_VALUE |
One of two meanings:
|
If neither CONNDLG_RO_PATH nor CONNDLG_USE_MRU is set in dwFlags, then the request defaults to CONNDLG_RO_PATH if lpRemoteName does not specify a remote path to CONNDLG_USE_MRU. Otherwise, CONNDLG_PERSIST and CONNDLG_NOT_PERSIST cannot both be set. If neither is set, then the dialog defaults to the last option that was selected on this dialog for the particular type of device being connected.