Solved

Need API function for Local system folder details

Posted on 2001-08-21
7
347 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

732 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