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

BROWSEINFO & pidlRoot

1,196 views
Skip to first unread message

Lamblion

unread,
Jul 24, 2009, 12:28:01 PM7/24/09
to
I can't figure out how to get the string of a folder location into pidlRoot
of a BROWSEINFO structure for SHBrowseForFolder(). I think I have to call
another function first, but I don't know how to convert that into a
PCIDLIST_ABSOLUTE. A short example would be appreciated.

Richard Russell

unread,
Jul 24, 2009, 6:48:50 PM7/24/09
to
On Jul 24, 5:28 pm, Lamblion <Lambl...@discussions.microsoft.com>
wrote:

> I can't figure out how to get the string of a folder location into pidlRoot
> of a BROWSEINFO structure for SHBrowseForFolder().

Use IShellFolder::ParseDisplayName to convert your folder string to a
PIDL:

http://msdn.microsoft.com/en-us/library/bb775090.aspx

Richard.
http://www.rtrussell.co.uk/
To reply by email change 'news' to my forename.

Timo Kunze

unread,
Jul 24, 2009, 7:17:31 PM7/24/09
to
Richard Russell schrieb:

> On Jul 24, 5:28 pm, Lamblion <Lambl...@discussions.microsoft.com>
> wrote:
>> I can't figure out how to get the string of a folder location into pidlRoot
>> of a BROWSEINFO structure for SHBrowseForFolder().
>
> Use IShellFolder::ParseDisplayName to convert your folder string to a
> PIDL:
>
> http://msdn.microsoft.com/en-us/library/bb775090.aspx

Or ILCreateFromPath:

http://msdn.microsoft.com/en-us/library/dd378420.aspx

Timo
--
www.TimoSoft-Software.de - Unicode controls for VB6
"Those who sacrifice freedom for safety deserve neither."
"Demokratie ist per Definition unsicher. Ihr Schutz entsteht aus der
Überzeugung, dass die demokratischen Kräfte überwiegen und sich – auf
demokratischem Wege – durchsetzen."

Lamblion

unread,
Jul 24, 2009, 9:01:01 PM7/24/09
to
Thangks, guys. I tried both, and the second one is really simple. However,
the problem I have now is that if I set a subdirectory, it will not allow me
to choose any folders above it.

I would like the dialog to open at a selected folder, but also be able to
move higher up instead of only down.

Ivo Beltchev

unread,
Jul 24, 2009, 10:48:25 PM7/24/09
to

If you are asking how to set the initial folder in the browser, here's how:
http://www.codeproject.com/KB/winsdk/Win32TipsAndTricks.aspx#browse1
Basically you send it BFFM_SETSELECTION from inside the callback function.

Ivo

Lamblion

unread,
Jul 25, 2009, 7:44:01 AM7/25/09
to
Thanks, Ivo. That is exactly what I was looking for.

Remy Lebeau

unread,
Jul 27, 2009, 4:04:03 PM7/27/09
to

"Lamblion" <Lamb...@discussions.microsoft.com> wrote in message
news:43B1546C-E659-4AA2...@microsoft.com...

> I can't figure out how to get the string of a folder location into
> pidlRoot of a BROWSEINFO structure for SHBrowseForFolder().

Use SHGetDesktopFolder() to get the top-level IShellFolder interface for the
Desktop namespace, then pass the string to its ParseDisplayName() method.

--
Remy Lebeau (TeamB)


Remy Lebeau

unread,
Jul 27, 2009, 4:06:45 PM7/27/09
to

"Lamblion" <Lamb...@discussions.microsoft.com> wrote in message
news:D4B44F06-7FF0-47AE...@microsoft.com...

> However, the problem I have now is that if I set a subdirectory,
> it will not allow me to choose any folders above it.

That is what pidlRoot is supposed to do. It is the "root" of the dialog.
You can only select items underneath the "root" folder.

> I would like the dialog to open at a selected folder, but also be able
> to move higher up instead of only down.

Then you need to set the pidlRoot to something higher up the hierarchy (such
as the PIDL for the CSIDL_DRIVES folder), and then use a callback function
(specified in the BROWSEINFO.lpfn member) to send a BFFM_SETSELECTION
message to the dialog when the callback receives the BFFM_INITIALIZED
notification.

--
Remy Lebeau (TeamB)


0 new messages