Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SHBrowseForFolder

224 views
Skip to first unread message

Sacha (Pacha)

unread,
Jan 1, 2007, 2:48:53 PM1/1/07
to
Happy New Year to everybody

Is somebody aware of the "BIF values" of the "ulFlags"
described by microsoft in :
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/structures/browseinfo.asp

I got the following from Jean-Claude Bellamy ( http://www.bellamyjc.org ) :
BIF_returnonlyfsdirs = &H0001
BIF_dontgobelowdomain = &H0002
BIF_editbox = &H0010
BIF_validate = &H0020
BIF_browseforcomputer = &H1000

But I would be happy to get the Hex values for
'BIF_NONEWFOLDERBUTTON'
(and the other too if possible !)

Thank you very much

Sacha


Message has been deleted

Sacha (Pacha)

unread,
Jan 1, 2007, 4:35:06 PM1/1/07
to
Thank you for the very quick answer although it is a special day ...
Your indication is helpfull :

BIF_returnonlyfsdirs = &H0001
BIF_dontgobelowdomain = &H0002
BIF_browseforcomputer = &H1000
BIF_NEWDIALOGSTYLE = &H0040
BIF_NONEWFOLDERBUTTON = &H0200
despite this declaration it does not work as I want :
the dialog boix is resizeable ... well ... but I have always the button to
create a new folder ; if you ckick n-times ... it goes very awfull.
Sacha.

"Alexander Mueller" <mill...@hotmail.com> a écrit dans le message de news:
45998b16$0$27615$9b4e...@newsspool2.arcor-online.net...

> As copied from ShlObj.h (from the PSDK-includes of VS-2005):
>
> #define BIF_RETURNONLYFSDIRS 0x0001 // For finding a folder to start
> document searching
> #define BIF_DONTGOBELOWDOMAIN 0x0002 // For starting the Find Computer
> #define BIF_STATUSTEXT 0x0004 // Top of the dialog has 2 lines
> of text for BROWSEINFO.lpszTitle and one line if
> // this flag is set. Passing the
> message BFFM_SETSTATUSTEXTA to the hwnd can set the
> // rest of the text. This is not
> used with BIF_USENEWUI and BROWSEINFO.lpszTitle gets
> // all three lines of text.
> #define BIF_RETURNFSANCESTORS 0x0008
> #define BIF_EDITBOX 0x0010 // Add an editbox to the dialog
> #define BIF_VALIDATE 0x0020 // insist on valid result (or
> CANCEL)
>
> #define BIF_NEWDIALOGSTYLE 0x0040 // Use the new dialog layout with
> the ability to resize
> // Caller needs to call
> OleInitialize() before using this API
>
> #define BIF_USENEWUI (BIF_NEWDIALOGSTYLE | BIF_EDITBOX)
>
> #define BIF_BROWSEINCLUDEURLS 0x0080 // Allow URLs to be displayed or
> entered. (Requires BIF_USENEWUI)
> #define BIF_UAHINT 0x0100 // Add a UA hint to the dialog, in
> place of the edit box. May not be combined with BIF_EDITBOX
> #define BIF_NONEWFOLDERBUTTON 0x0200 // Do not add the "New Folder"
> button to the dialog. Only applicable with BIF_NEWDIALOGSTYLE.
> #define BIF_NOTRANSLATETARGETS 0x0400 // don't traverse target as
> shortcut
>
> #define BIF_BROWSEFORCOMPUTER 0x1000 // Browsing for Computers.
> #define BIF_BROWSEFORPRINTER 0x2000 // Browsing for Printers
> #define BIF_BROWSEINCLUDEFILES 0x4000 // Browsing for Everything
> #define BIF_SHAREABLE 0x8000 // sharable resources displayed
> (remote shares, requires BIF_USENEWUI)
>
>
>
>
> change the C-styled pre-processor macros
>
> #define BIF_NONEWFOLDERBUTTON 0x0200 // Do not add the "New Folder"
> button
>
> to VB-styled consts
>
> Const BIF_NONEWFOLDERBUTTON = &H200 ' Do not add the "New Folder" button
>
>
>
> MfG,
> Alex


Message has been deleted

Ayush

unread,
Jan 2, 2007, 3:11:49 AM1/2/07
to
Replied to [Sacha (Pacha)]s message :

> Happy New Year to everybody
>
> Is somebody aware of the "BIF values" of the "ulFlags"
> described by microsoft in :
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/structures/browseinfo.asp

From text file posted by mr_unreliable(originally posted by Joe Earnest) :

BIF_RETURNONLYFSDIRS = &H0001 ' For finding a folder to start document searching
BIF_DONTGOBELOWDOMAIN = &H0002 ' For starting the Find Computer
BIF_STATUSTEXT = &H0004
BIF_RETURNFSANCESTORS = &H0008
BIF_EDITBOX = &H0010
BIF_VALIDATE = &H0020 ' insist on valid result (or CANCEL)
BIF_NEWDIALOGSTYLE = &H0040 ' (Version 5.0). use the new user interface. (you
get a larger dialog box, with several new capabilities
BIF_BROWSEFORCOMPUTER = &H1000 ' Browsing for Computers
BIF_BROWSEFORPRINTER = &H2000 ' Browsing for Printers
BIF_BROWSEINCLUDEFILES = &H4000 ' Browsing for Everything

' Shell Special Folder constants...
'You can use any of these for specifying root folder..(i know there are many other
easy ways..)
ssfDESKTOP = 0
ssfPROGRAMS = 2
ssfCONTROLS = 3
ssfPRINTERS = 4
ssfPERSONAL = 5
ssfFAVORITES = 6
ssfSTARTUP = 7
ssfRECENT = 8
ssfSENDTO = 9
ssfBITBUCKET = 10
ssfSTARTMENU = 11
ssfDESKTOPDIRECTORY = 16 ' (&H10)
ssfDRIVES = 17 ' (&H11) MyComputer Drives
ssfNETWORK = 18 ' (&H12)
ssfNETHOOD = 19 ' (&H13)
ssfFONTS = 20 ' (&H14)
ssfTEMPLATES = 21 ' (&H15)
ssfCOMMONSTARTMENU = 22 ' (&H16)
ssfCOMMONPROGRAMS = 23 ' (&H17)
ssfCOMMONSTARTUP = 24 ' (&H18)
ssfCOMMONDESKTOPDIR = 25 ' (&H19)
ssfAPPDATA = 26 ' (&H1A)
ssfPRINTHOOD = 27 ' (&H1B)
ssfLOCALAPPDATA = 28 ' (&H1C)
ssfALTSTARTUP = 29 ' (&H1D)
ssfCOMMONALTSTARTUP = 30 ' (&H1E)
ssfCOMMONFAVORITES = 31 ' (&H1F)
ssfINTERNETCACHE = 32 ' (&H20)
ssfCOOKIES = 33 ' (&H21)
ssfHISTORY = 34 ' (&H22)
ssfCOMMONAPPDATA = 35 ' (&H23)
ssfWINDOWS = 36 ' (&H24)
ssfSYSTEM = 37 ' (&H25)
ssfPROGRAMFILES = 38 ' (&H26)
ssfMYPICTURES = 39 ' (&H27)
ssfPROFILE = 40 ' (&H28)
ssfSYSTEMx86 = 41 ' (&H29)
ssfPROGRAMFILESx86 = 48 ' (&H30)

--
→ Ayush
-------------
Search - www.Google.com | Wikipedia - http://en.wikipedia.org
Snip your long urls - http://snipurl.com/
-------------

Sacha (Pacha)

unread,
Jan 2, 2007, 11:07:47 PM1/2/07
to
Thank you very much ... and now it works :
Const WINDOW_HANDLE = 0
Const OPTIONS = &H0241
vide = "C:\" '(pour restreindre la navigation ...) ou "." ou RIEN
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.BrowseForFolder(WINDOW_HANDLE, "Sélection de
dossier : ", OPTIONS, vide)
If objFolder Is Nothing Then
Wscript.Quit
End If
Set objFolderItem = objFolder.Self
objPath = objFolderItem.Path
Wscript.Echo objPath
the explanation is : first OPTIONS was equal to &H0001 ... I ommitted to add
the values to 'build' what I wanted ;
to avoid selection of unusable folders like "my computer" or "my handheld"
or anything according to the OPTIONS value (see below),
and a lot of "If Instr(objPath, ...End If" which are also related to the
interface language,
I decided to keep the 'vide' parameter set to "C:\" and I 'm happy with it.
I got this also from an other source ( a VBnet forum) :
'For finding a folder to start document searching
Private Const BIF_RETURNONLYFSDIRS As Long = &H1
'For starting the Find Computer
Private Const BIF_DONTGOBELOWDOMAIN As Long = &H2
'Add an editbox to the dialog: SHELL 5.0 or later only!
Private Const BIF_EDITBOX As Long = &H10
'insist on valid result (or CANCEL)
Private Const BIF_VALIDATE As Long = &H20
'Use the new dialog layout with the ability 'to resize: SHELL 5.0 or
later only!
Private Const BIF_NEWDIALOGSTYLE As Long = &H40
Private Const BIF_USENEWUI As Long = (BIF_NEWDIALOGSTYLE Or BIF_EDITBOX)
'Allow URLs to be displayed or entered
'(Requires BIF_USENEWUI): SHELL 5.0 or later only!
Private Const BIF_BROWSEINCLUDEURLS As Long = &H80
'Add a UA hint to the dialog, in place of the
'edit box. May not be combined with BIF_EDITBOX: SHELL 6.0 or later
only!
Private Const BIF_UAHINT As Long = &H100
'Do not add the "New Folder" button to the dialog.
'Only applicable with BIF_NEWDIALOGSTYLE: SHELL 5.0 or later only!
Private Const BIF_NONEWFOLDERBUTTON As Long = &H200
'Browsing for Computers
Private Const BIF_BROWSEFORCOMPUTER As Long = &H1000
'Browsing for Printers
Private Const BIF_BROWSEFORPRINTER As Long = &H2000
'Browsing for Everything
Private Const BIF_BROWSEINCLUDEFILES As Long = &H4000
'sharable resources displayed (remote shares,
'requires BIF_USENEWUI): SHELL 5.0 or later only!
Private Const BIF_SHAREABLE As Long = &H8000&
it is to explain the "OPTIONS = &H0241" ... I tried also ' vide ="" ' and
"OPTIONS=&H8241" or "OPTIONS=&HC241".

Sacha

"Alexander Mueller" <mill...@hotmail.com> a écrit dans le message de news:

459a1052$0$5728$9b4e...@newsspool3.arcor-online.net...


> 01.01.2007 22:35, Sacha (Pacha) schrieb:
>> Thank you for the very quick answer although it is a special day ...
>> Your indication is helpfull :
>> BIF_returnonlyfsdirs = &H0001
>> BIF_dontgobelowdomain = &H0002
>> BIF_browseforcomputer = &H1000
>> BIF_NEWDIALOGSTYLE = &H0040
>> BIF_NONEWFOLDERBUTTON = &H0200
>> despite this declaration it does not work as I want :
>> the dialog boix is resizeable ... well ... but I have always the button
>> to
>> create a new folder ; if you ckick n-times ... it goes very awfull.
>> Sacha.
>

> Can't repro the behaviour you describe, try:
>
> Set sh = CreateObject("Shell.Application")
> sh.BrowseForFolder 0, "Select a folder", &H200 Or &H40, 0
>
> Note that BIF_NONEWFOLDERBUTTON requires shell32.dll version >= 6.0
> which iirc means Windows XP or higher.
>
>
> MfG,
> Alex


Fosco

unread,
Jan 2, 2007, 11:52:01 PM1/2/07
to
"Ayush" <"ayushmaan.j[aatt]gmail.com">

> ssfDESKTOP = 0
> ssfPROGRAMS = 2


Not reliable , they are different on a Win9x and i.e. on a WinXP :

Set sh = CreateObject("WScript.Shell")
s = sh.SpecialFolders(11)
msgbox s

Set oShell = WScript.CreateObject("WScript.Shell")
x = oShell.RegRead("HKCU\Software\Microsoft\Windows\"&_
"CurrentVersion\Explorer\Shell Folders\Favorites")

if s = x then

msgbox s
else
msgbox "No Match"
end if


--
Fosco


0 new messages