Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
platform
active.directory
adsi
adsi.iis-admin
base
com_ole
complus_mts
component_svcs
database
directx
gdi
graphics_mm
internet.client
internet.server
internet.server.isapi-dev
localization
mapi
messaging
msi
mslayerforunicode
multimedia
networking
networking.ipv6
sdk_install
security
shell
telephony.tapi_2
telephony.tapi_3
telephony.tsp
telephony.wte
tools
ui
ui_shell
win_base_svcs
win16
  
 
date: Mon, 18 Aug 2008 09:55:11 -0700 (PDT),    group: microsoft.public.platformsdk.shell        back       


Determining the "type" of a folder?   
Given an IShellFolder, is there a way to determine if it represents a
hard disk drive, a floppy drive, a CD drive, a network share, a USB
drive, et cetera?

The only vaguely similar thing I've found so far is the
SFGAO_REMOVABLE flag of IShellFolder::GetAttributesOf (obviously I
would have to do that relative to the folder's parent).  But that's
not very detailed, and also the docs seem to indicate that anything on
removable media would have this set (as opposed to just the drive's
root).

Thanks in advance for any help.
date: Mon, 18 Aug 2008 09:55:11 -0700 (PDT)   author:   unknown

Re: Determining the "type" of a folder?   
If I rember correctly this can be done by getting the root letter of
the path. Win32 has an API called GetDriveType that will return the
type of the drive (see docs how to use it). There are also some helper
functions in win32 that make it easy to get root letter from a full
path.
date: Mon, 18 Aug 2008 13:06:04 -0700 (PDT)   author:   unknown

Re: Determining the "type" of a folder?   
[Reposted due to buggy MS news servers dropping messages]

nifbuptuck@gmail.com wrote:
> Given an IShellFolder, is there a way to determine if it represents a
> hard disk drive, a floppy drive, a CD drive, a network share, a USB
> drive, et cetera?
> 
> The only vaguely similar thing I've found so far is the
> SFGAO_REMOVABLE flag of IShellFolder::GetAttributesOf (obviously I
> would have to do that relative to the folder's parent).  But that's
> not very detailed, and also the docs seem to indicate that anything on
> removable media would have this set (as opposed to just the drive's
> root).

You could try SHGetDataFromIDList with the SHGDFIL_DESCRIPTIONID format. -- 
Jim Barry, Microsoft MVP
date: Sun, 31 Aug 2008 18:13:12 +0100   author:   Jim Barry

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us