Solved

Need API function for Local system folder details

Posted on 2001-08-21
7
341 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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

757 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