Solved

Need API function for Local system folder details

Posted on 2001-08-21
7
342 Views
Last Modified: 2012-06-27
Hi Experts
Is there any API function which will show dialog box which contains
only the local drive only, not even mapped drive ?
I tried with SHBrowseForFolder but then it is allowing me to select
the mapped drive.
Awiting for your reply
0
Comment
Question by:rakesh_manohar
7 Comments
 
LVL 1

Expert Comment

by:Vinda
ID: 6409769
Try the FolderTreeView control (its freeware, i guess) developed by CCRP (http://www.mvps.org/ccrp). That control has the same behavior.

0
 
LVL 1

Accepted Solution

by:
Madmarlin earned 50 total points
ID: 6410106
Try the fso (File System Object) in VB.
Its amazing and I beleive will give you what you want, along with tons of cool functions that allows you to quickly retreive such information.

Cant actually remember what its referenced as but shouldn;t be too hard to find out.
The fso is basically a wrapper for loads of different API calls relating to your system structure and files..

Madmarlin
0
 
LVL 4

Expert Comment

by:VincentLawlor
ID: 6410259
This is a bit of a work around but will restrict selection to your local machine.

Before the call to SHBrowseForFolder
Store the current valid folder in a variable.
After your call to SHBrowseForFolder
Check that the folder is a local folder with the following:

If GetDriveType(strFolderName) <> 2 then
    'Call SHBrowseForFolder again or popup a message box
End If

The code to check the drive type is:

Public Function GetDriveType(strFolderName as String) as Integer

    Dim fs,drive
    On Error Resume Next
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set drive = fs.GetDrive(fs.GetDriveName(strFolderName))
    GetDriveType = drive.DriveType
    Set drive = Nothing
    Set fs = Nothing

End Function

Vin.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 14

Expert Comment

by:wsh2
ID: 6410502
rakesh_manohar Question History:

Questions Asked 13
Last 10 Grades Given A B A  
Question Grading Record 3 Answers Graded / 3 Answers Received

TEN Open Questions dating back to March of this year.

rakesh_manohar - PLEASE maintian YOUR other Questions with a comment, grade, or deletion before proceeding here.


0
 
LVL 4

Expert Comment

by:VincentLawlor
ID: 6410513
wsh2
can you post the url's for the open questions I seem to remember this guy.

Vin.
0
 
LVL 14

Expert Comment

by:wsh2
ID: 6410557
VincentLawlor:

Click on the "1.comment or answer for akesh_manohar" perlink at the bottom / top of this question -or- htp://www.experts-exchange.com/jsp/memberProfile.jsp?mbr=rakesh_manohar

and then click on the View Question history button.
0
 
LVL 4

Expert Comment

by:VincentLawlor
ID: 6412562
wsh2 >> Cheers

Vin.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now