PackDefaultParamStruct: Difference between revisions

From TotalcmdWiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 1: Line 1:
PackSetDefaultParams is called immediately after loading the DLL, before any other function. This function is new in version 2.1. It requires Total Commander >=5.51, but is ignored by older versions.
PackDefaultParamStruct is passed to PackSetDefaultParams to inform the plugin about the current plugin interface version and ini file location.


   void __stdcall PackSetDefaultParams(PackDefaultParamStruct* dps);
   typedef struct {
    int size;
      DWORD PluginInterfaceVersionLow;
      DWORD PluginInterfaceVersionHi;
      char DefaultIniName[MAX_PATH];
    } PackDefaultParamStruct;


== Description ==  
== Description ==


* dps : this structure of type '''PackDefaultParamStruct''' currently contains the version number of the plugin interface, and the suggested location for the settings file (ini file). It is recommended to store any plugin-specific information either directly in that file, or in that directory under a different name. Make sure to use a unique header when storing data in this file, because it is shared by other file system plugins! If your plugin needs more than 1kbyte of data, you should use your own ini file because ini files are limited to 64k.
* ''size'': the size of the structure, in bytes. Later revisions of the plugin interface may add more structure members, and will adjust this size field accordingly.
 
* ''PluginInterfaceVersionLow'': low value of plugin interface version. This is the value after the comma, multiplied by 100! Example. For plugin interface version 2.1, the low DWORD is 10 and the high DWORD is 2.
'''Return value:'''
* ''PluginInterfaceVersionHi'': High value of plugin interface version.
 
* ''DefaultIniName'': Suggested location+name of the ini file where the plugin could store its data. This is a fully qualified path+file name, and will be in the same directory as the wincmd.ini. It's recommended to store the plugin data in this file or at least in this directory, because the plugin directory or the Windows directory may not be writable!
The function has no return value:
 
'''Important note:'''
 
This function is only called in Total Commander 5.51 and later. The plugin version will be >= 2.1.

Revision as of 16:05, 18 April 2006

PackDefaultParamStruct is passed to PackSetDefaultParams to inform the plugin about the current plugin interface version and ini file location.

 typedef struct {
   int size;
     DWORD PluginInterfaceVersionLow;
     DWORD PluginInterfaceVersionHi;
     char DefaultIniName[MAX_PATH];
   } PackDefaultParamStruct;

Description

  • size: the size of the structure, in bytes. Later revisions of the plugin interface may add more structure members, and will adjust this size field accordingly.
  • PluginInterfaceVersionLow: low value of plugin interface version. This is the value after the comma, multiplied by 100! Example. For plugin interface version 2.1, the low DWORD is 10 and the high DWORD is 2.
  • PluginInterfaceVersionHi: High value of plugin interface version.
  • DefaultIniName: Suggested location+name of the ini file where the plugin could store its data. This is a fully qualified path+file name, and will be in the same directory as the wincmd.ini. It's recommended to store the plugin data in this file or at least in this directory, because the plugin directory or the Windows directory may not be writable!