The WNetConnectionDialog function creates a dialog box that allows the user to browse network resources and connect and disconnect from them. The following code fragment shows how to use the WNetConnectionDialog function to create a dialog that displays disk resources:
DWORD dwResult;
dwResult = WNetConnectionDialog(hwnd,
RESOURCETYPE_DISK);
if(dwResult != NO_ERROR) {
/* Locally defined error handler. */
ErrorHandler(hwnd, dwResult, "WNetConnectionDialog");
return FALSE;
}