Winecfg -> browse for folder

Rolf Kalbermatter rolf.kalbermatter at
Wed Nov 24 15:45:38 CST 2004

Robert van Herk <robert at> wrote:

>Also, I am having some troubles into tricking the SHBrowseForFolder 
>thingy into using a different root folder, since I guess I need to use 
>for that, but that doesn't seem to be implemented in Wine.

This shouldn't be to difficult I guess. There are helper functions in
shell32.pidl.c which should be close to what this function does actually. 

Something like this in pidl.c should do the trick:

HRESULT WINAPI SHParseDisplayNameW(LPCWSTR pszName, IBindCtx *pbc, LPITEMIDLIST *ppidl,
                                   SFGAOF sfgaoIn, SFGAOF *psfgaoOut)


	TRACE("%s %p 0x%08lx\n", debugstr_w(pszName), ppidl, attributes ? *attributes : 0);

	if (SUCCEEDED (SHGetDesktopFolder(&sf)))
	  ret = IShellFolder_ParseDisplayName(sf, 0, pbc, (LPOLESTR)pszName, NULL, ppidl, &sfgaoIn);
	  if (succeeded && psfgaoOut)
	    *psfgaoOut = sfgaoIn;
	return ret;

Or you could probably use SHILCreateFromPathW() too for your purposes, which is similar.

>Finally, I don't know how to free PIDLS. In the MSDN documentation they 
>use C++ calls for that, but I don't know how to port that to C.

ILFree() exported as ordinal 155 from shell32 should be the function to use.
It was undocumented in Windows for a long time but exists in shell32 since
at least Win95.

Rolf Kalbermatter

More information about the wine-devel mailing list