I use SHGetSpecialFolderLocation()
to determine the IDCList entry for a special directory:
_ = Win32API.Shell32.SHGetSpecialFolderLocation(hWndWindow, (int)RootDirectory, out IntPtr pidlRoot); // Determine IDCList for the root directory via a special directory listing
I then display it as the root directory in a directory dialog using SHBrowseForFolder()
:
pidlRet = Win32API.Shell32.SHBrowseForFolder(ref bi); // Show directory dialog
However, when I run this for e.g. CSIDL_MYDOCUMENTS
(0x005), the root directory points to an empty directory structure, although there are subdirectories in MyDocuments (see image).
The return value (PIDCList) of the directory dialog whose directory I'm querying with SHGetPathFromIDList()
:
SHGetPathFromIDList(IDList, sb))
refers to a directory that does not exist:
C:\Users\fred.aurich\Documents
the user document directory is:
C:\Benutzer\fred.aurich\Dokumente
Is that possibly the cause? Or how do I get the subfolders displayed in the directory dialog via CSIDL_MYDOCUMENTS
???
Folder Browser and result:
Inclusion of the Forms assembly:
- Internet research
- Display of subfolders