|
Windows XP(2000) 以降だったかな?
Shell32 に Folder3 という Object ができて、
表示される Shortcut の実体も透過的に扱える Self という
Property が出来ました。
'[BROWSEINFO]構造体使用オプションフラグ列挙型定数(ulFlags)
Enum BrowseInfoFlags
BIF_RETURNONLYFSDIRS = &H1
BIF_DONTGOBELOWDOMAIN = &H2
BIF_STATUSTEXT = &H4
BIF_RETURNFSANCESTORS = &H8
BIF_EDITBOX = &H10
BIF_VALIDATE = &H20
BIF_NEWDIALOGSTYLE = &H40
BIF_USENEWUI = (BIF_NEWDIALOGSTYLE Or BIF_EDITBOX)
BIF_BROWSEINCLUDEURLS = &H80
BIF_UAHINT = &H100
BIF_NONEWFOLDERBUTTON = &H200
BIF_NOTRANSLATETARGETS = &H400
BIF_BROWSEFORCOMPUTER = &H1000
BIF_BROWSEFORPRINTER = &H2000
BIF_BROWSEINCLUDEFILES = &H4000
BIF_SHAREABLE = &H8000
End Enum
Function strBrowseForFolderPath( _
ByRef strTitle As String, _
Optional ByVal lngHwnd As Long = 0, _
Optional ByVal lngOptions As BrowseInfoFlags = 0, _
Optional ByRef strRoot As String = "") As String
Dim objShell As New Shell32.Shell
Dim objFolder As Shell32.Folder3
Set objFolder = objShell.BrowseForFolder( _
lngHwnd, strTitle, lngOptions, strRoot)
If Not objFolder Is Nothing Then
If objFolder.Self.IsFileSystem = True Then
strBrowseForFolderPath = objFolder.Self.Path
Set objFolder = Nothing
End If
End If
Set objShell = Nothing
End Function
|
|