PIDL ids in Favorites file

In a next release, my app Quick Access Popup (compiled AutoHotkey script) will integrate the Directory Opus favorites in its menu. To build the "Directory Opus Favorites", I'm parsing the XML file C:\Users\UserName\AppData\Roaming\GPSoftware\Directory Opus\ConfigFiles\favorites.ofv

When special folders (like My PC, Network or Recycle Bin) are added to the favorites, DOpus stores them in favorites.ofv as PIDL ids like:

  • My Computer: ?AAAAFAAfUOBP0CDqOmkQotgIACswMJ0AAA==
  • Network: ?AAAAFAAfWA0aLPAhvlBDiLBzZ/yW7zwAAA==
  • Recycle Bin: ?AAAAFAAfeEDwX2SBUBsQnwgAqgAvlU4AAA==

I found little info about PIDL on DOPus website. It there a list of supported PIDLs? Ideally, I would map them with DOpus aliases "mycomputer", "network" or "trash" and use these aliases to open the special folders in DOpus listers.

If this is not possible, is it safe to open these PIDL with DOpusRt commands like:
"C:\Program Files\GPSoftware\Directory Opus\dopusrt.exe" /acmd Go "?AAAAFAAfUOBP0CDqOmkQotgIACswMJ0AAA=="

Thanks.

They are basically the binary data of the PIDL as a base64-encoded string.

We don't generally advise parsing the Opus config files directly as they are subject to change. We have exported functions in dopuslib.dll that you may be able to use to access the Favorites information - yell out if you'd like details.

Yes, please. I suppose I would be able to call these functions using the AutoHotkey DLLCall command but I will need help from AHK forum friends to do this because DLL calls are still a bit like a magic hat for me :slight_smile: .

The following functions are all exported by name from dopuslib.dll, using the __cdecl calling convention.

HANDLE GetFavoritesList()
- returns a HANDLE to the favorites list
HANDLE GetRecentList()
- returns a HANDLE to the recent list
HANDLE GetPathAliasList()
- returns a HANDLE to the path alias list
void FreeFavoritesList(HANDLE hList)
- frees one of the above lists

HANDLE GetFirstPathEntry(HANDLE hList)
- when given a HANDLE to a path list or sub-folder, returns a HANDLE to the first path entry (non-folder)
HANDLE GetNextPathEntry(HANDLE hEntry)
- when given a HANDLE to a path entry, returns the next path entry
HANDLE GetFirstSubfolder(HANDLE hList)
- when given a HANDLE to a path list or sub-folder, returns a HANDLE to the first sub-folder
HANDLE GetNextSubfolder(HANDLE hEntry)
- when given a HANDLE to a sub-folder, returns the next sub-folder
BOOL GetEntryLabelA(HANDLE hEntry,LPSTR lpszLabel,int iMax)
- when given a HANDLE to a path entry or sub-folder, returns the label (ANSI)
BOOL GetEntryLabelW(HANDLE hEntry,LPWSTR lpszLabel,int iMax)
- when given a HANDLE to a path entry or sub-folder, returns the label (Unicode)
BOOL GetEntryPathA(HANDLE hEntry,LPSTR lpszPath,int iMax)
- when given a HANDLE to a path entry, returns the path string (ANSI)
BOOL GetEntryPathW(HANDLE hEntry,LPWSTR lpszPath,int iMax)
- when given a HANDLE to a path entry, returns the path string (Unicode)

Thanks, Jon. I'll have to figure out how to build my DLL calls but I know I will be able with some help.

But, first, at high level,I would like to confirm the structure of the script I have to do. To scan the top-level favorites folder and its sub-levels, I would need to build a recursive function that will read the list returned by GetFavoritesList() .

Normally, I would read the first item at level 1 and, if it is a folder, "recurse" my function to process the folder at level 2 and, after this folder is processed (including deeper recursion if needed), return to level 1 to continue with the next item. Etc. I hope I'm clear.

Which function would return the list items sequentially regardless if it is a path or a folder, allowing me to determine if I process it as a path or if I recurse to the sub-folder?

There isn't one function for that, but you could simulate it easily enough, e.g.:

HANDLE h = GetFirstSubfolder(hList);
while (h != NULL)
{
	// process folder, then
	h = GetNextSubfolder(hList);
}

HANDLE h = GetFirstPathEntry(hList);
while (h != NULL)
{
	// process favorite entry, then
	h = GetNextPathEntry(hList);
}

What I don't get is how I could recreate the Favorites Folders tree view as it is managed and displayed in DOpus. These functions would allow to retrieve the favorites but, in my understanding, not to put them in the correct order/levels.

They give you the hierarchy, although they'll give separate lists of items and subfolders at each level, so it may not quite be identically sorted, if the two are interleaved within a particular level. That seems OK though.

Hi Leo and Jon,

I took some time to explorer this before coming back to you. It turns out that working with dopuslib.dll is very difficult to me with my current level of expertise. Parsing an XML file is much easier and it more easily carry the recursive structure of the DOpus favorites menu.

I understand that you prefer external programs not to parse the Opus config files directly as they are subject to change. But, assuming that I may have to adapt my app if you change the favorites XML structure, it will be much easier for me to integrate DOpus favorites to Quick Access Popup menu by parsing this file. Hope this is good for you.

Thanks for you help,

Jean

1 Like