GetFindData

Far Manager

GetFindData

The GetFindData function is called to get the list of files in the current directory of the file system emulated by the plugin.
(FAR to plugin: "let me look at your file list, allocate the memory yourself :-)").
int WINAPI GetFindData(
  HANDLE hPlugin,
  struct PluginPanelItem **pPanelItem,
  int *pItemsNumber,
  int OpMode
);

Parameters

hPlugin
Plugin handle returned by OpenPlugin or OpenFilePlugin.
pPanelItem
Points to a variable that receives the address of a PluginPanelItem structures array.
pItemsNumber
Points to a variable that receives the number of PluginPanelItem structures.
OpMode
Combination of the operation mode flags. This function should be ready to process the OPM_FIND flag.

Return value

If the function succeeds, the return value must be TRUE. If the function fails, FALSE should be returned.

Remarks

  1. The memory for the requested data should be allocated by the plugin. Because of that it is important to export the FreeFindData function so the allocated memory will be freed when no longer needed.
  2. If this function returns FALSE, the plugin will be closed.
  3. In some cases (for example when searching in archives Alt-F7) a panel in not created physically, so it necessary to check the return value of the Control function, to prevent a crash in the most upappropriate moment while carying out work for a none existant panel.
  4. If you want to prevent your plugin from participating in the "search in archive" ("[x] Search in archives" in the Find file dialog) then return FALSE when OpMode contains the OPM_FIND flag.
See also: