VFS_GetFileIcon(
HANDLE:hVFSData,
LPVFSFUNCDATA:lpFuncData,
LPTSTR:lpszFile,
LPINT:lpiSysIconIndex,
HICON*:phLargeIcon,
HICON*:phSmallIcon,
LPBOOL:lpfDestroyIcons,
LPTSTR:lpszCacheName,
int:cchCacheNameMax,
LPINT:lpiCacheIndex
)
→ BOOL
The VFS_GetFileIcon function is called to retrieve the icon for a file or folder in your plugin's namespace.
You can either use the lpiSysIconIndex parameter to return an index to an icon in the system image list, or phLargeIcon and phSmallIcon to return actual icons. To use the system image list, simply store the index value in lpiSysIconIndex and return TRUE.
To return icon images you must place the HICON handles in the supplied phLargeIcon and phSmallIcon parameters. If you want Opus to destroy the icons with DestroyIcon you should set lpfDestroyIcons to TRUE - otherwise, set lpfDestroyIcons to FALSE if you want to destroy the icons yourself. Note though that if you do not ask Opus to destroy them they must remain valid for as long as your namespace instance handle is valid (that is, until Opus destroys it with VFS_Destroy.)
Opus is able to cache icon images returned in this manner to save memory. To take advantage of this, copy a unique name into the buffer pointed to by lpszCacheName. For example, you could use a UUID or a combination of your plugin's name and a random number for the cache name. You can also provide a cache index in the lpiCacheIndex parameter.