CONNECTDLGSTRUCTA structure (winnetwk.h)
The CONNECTDLGSTRUCT structure is used by the WNetConnectionDialog1 function to establish browsing dialog box parameters.
Syntax
typedef struct _CONNECTDLGSTRUCTA {
DWORD cbStructure;
HWND hwndOwner;
LPNETRESOURCEA lpConnRes;
DWORD dwFlags;
DWORD dwDevNum;
} CONNECTDLGSTRUCTA, *LPCONNECTDLGSTRUCTA;
Members
cbStructure
Type: DWORD
The size, in bytes, of the CONNECTDLGSTRUCT structure. The caller must supply this value.
hwndOwner
Type: HWND
The handle to the owner window for the dialog box.
lpConnRes
Type: LPNETRESOURCE
A 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.
The system does not support the RESOURCETYPE_PRINT flag for browsing and connecting to print resources.
dwFlags
Type: DWORD
A set of bit flags that describe options for the dialog box display. This member can be a combination of the following values.
Value | Meaning |
---|---|
|
The account is a user account. |
|
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 member is not NULL (or an empty string), and the CONNDLG_USE_MRU flag is not set. |
|
Internal flag. Do not use. |
|
Enter the most recently used paths into the combination box. Set this value to simulate the WNetConnectionDialog function. |
|
Show the check box allowing the user to restore the connection at logon. |
|
Restore the connection at logon. |
|
Do not restore the connection at logon. |
For more information, see the following Remarks section.
dwDevNum
Type: DWORD
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.
Note
The winnetwk.h header defines CONNECTDLGSTRUCT as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 2000 Professional [desktop apps only] |
Minimum supported server | Windows 2000 Server [desktop apps only] |
Header | winnetwk.h |