Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Map Network Drive dialog box
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00194378
Message ID:
00194442
Views:
27
>>>>Hi, All!
>>>>
>>>>How can I show the user 'Map Network Drive' dialog box, like in Windows Explorer? Is there an API for this?
>>>>
>>>>TIA, Uri.
>>>
>>>Hi Uri,
>>>
>>>Here's what you need:
>>>#DEFINE RESOURCE_DRIVES    1
>>>#DEFINE NO_ERROR           0    && No error occurred.
>>>#DEFINE ERROR_CANCELLED 1223    && The user cancelled
>>>DECLARE INTEGER WNetConnectionDialog IN Win32API;
>>>  INTEGER hwnd, INTEGER fdwResourceType
>>>lnerr = WNetConnectionDialog(0, RESOURCE_DRIVES)
>>>IF NOT INLIST(lnerr, NO_ERROR, ERROR_CANCELLED)
>>>  * An error occurred
>>>ENDIF
>>>hth,
>>
>>Hello George, you answer helped me out also as I have been having trouble with making sure network resources were available. But my problem is this, I have established that UNC will be used through out my application, so I dont rely on the user being mapped to K: or J:, just that they are logged into the server. I will issue the \\402fs1\data\lotcard\data\drive.dbf to get to my data. So what I would like to know from you is how can I get to the second dialog that comes up from the above, when the user is not logged into the server. The dialog above lets them map a drive to a server resource, but if they are not logged in then it brings up the login screen. How can I just get the login screen to come up as I am using UNC's and mapping is not my problem?
>
>Hi Bret,
>
>According to the SDK: "If the function attempts to make a connection and the provider returns the message ERROR_INVALID_PASSWORD, Windows prompts the user to enter a password and uses the new password in another attempt to make the connection." The value for ERROR_INVALID_PASSWORD is 86. I'll have to investigate the login dialog. It doesn't appear in the WNet... group. Does this help?

So what your saying is that I should trick it into thinking that the password was invalid and thus the login screen will come up?
Bret Hobbs

"We'd have been called juvenile delinquents only our neighborhood couldn't afford a sociologist." Bob Hope
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform