0% found this document useful (0 votes)
232 views

FDM Plugins API

The document provides a tutorial on creating plugins for the Free Download Manager (FDM) using their Plugin SDK. It explains that the SDK currently only supports C++ and describes the required functions and interfaces to initialize and describe a plugin to FDM. When implemented, the plugin DLL needs to be placed in FDM's Plugins folder for it to be loaded and its functions called. The SDK provides access to FDM's API to interact with downloads and manager. Useful plugins may be submitted to the FDM team.

Uploaded by

Luiz Wenner
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
232 views

FDM Plugins API

The document provides a tutorial on creating plugins for the Free Download Manager (FDM) using their Plugin SDK. It explains that the SDK currently only supports C++ and describes the required functions and interfaces to initialize and describe a plugin to FDM. When implemented, the plugin DLL needs to be placed in FDM's Plugins folder for it to be loaded and its functions called. The SDK provides access to FDM's API to interact with downloads and manager. Useful plugins may be submitted to the FDM team.

Uploaded by

Luiz Wenner
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

1.

Requirements
FDM plugins SDK supports C++ language for now only. If you would like the support to be added for language you use, please write to [email protected]. Sorry for the possible inconvenience.

2. Short tutorial
Let's start from the short tutorial.

2.1. Make a Win32 DLL project 2.2. Add required exports


FDM looks for initialization function in the DLL. Its prototype should be the such: BOOL FdmApiPluginInitialize (vmsFdmApi* pFdmApi, DWORD* pdwSdkVersionPluginUse) So, DLL should export FdmApiPluginInitialize function. Once DLL will be loaded by FDM, it will call this function. Parameter pFdmApi will point to FDM plugin SDK main interface. Using this interface you can access all FDM's API features included in the current version of SDK. This interface and some other interfaces we'll describe a little later. Now let's implement this function. BOOL FdmApiPluginInitialize (vmsFdmApi*, DWORD *pdwSdkVersion) { *pdwSdkVersion = (FDMSDK_MAJOR_VERSION << 32) | FDMSDK_MINOR_VERSION; MessageBox (NULL, Plugin has been initialized, FDM plugin tutorial, MB_OK); return TRUE; } Interface vmsFdmApi is declared in fdm.h header of FDM plugins SDK, so include it into your project. FDM will call this function twice. First time pFdmApi parameter will be set to NULL. FDM will check if your plugin compatible with it using version information you provide. If it's ok, it will call this function again and provide its main interface. If the function will return FALSE plugin will not be loaded. The second exported function is FdmApiPluginShutdown. It's optional and you may not implement and export it. void FdmApiPluginShutdown () It will be called by FDM when the plugin is about to be unloaded. The third exported function is FdmApiPluginGetDescription (LPSTR pszPluginShortName, LPSTR pszPluginLongName, LPSTR pszPluginVersion, LPSTR pszPluginDescription). Example: void FdmApiPluginGetDescription (LPSTR pszPluginShortName, LPSTR pszPluginLongName, LPSTR pszPluginVersion, LPSTR pszPluginDescription) { strcpy (pszPluginShortName, FDMSP); strcpy (pszPluginLongName, FDM simple plugin); strcpy (pszPluginVersion, 1.0 beta build 5);

strcpy (pszPluginDescription, This plugin helps others understand how to write a plugin for FDM.); } The size of each buffer is 3000 bytes so make sure your description is not longer than this value.

2.3. Put your plugin's DLL into Plugins subfolder of FDM's installation folder. Restart FDM
That's all. The example of simple FDM's plugin is included with our plugins SDK.

3. FDM plugins API interfaces


The main interface is vmsFdmApi. All of its functions has self describing names. Using getDownloadsMgr method you'll get pointer to vmsFdmApiDownloadsMgr interface. Using this interface (vmsFdmApiDownloadsMgr) you may get the number of downloads in FDM, access every download in the FDM, create new download. For now, API is very simple, has few little headers only, so it is not required to write more here. A good starting example in this SDK should help you to get started very fast.

4. The last note


If you think your plugin may be useful to other users, please send it to us at [email protected]. We'll review it and maybe add it to our site or even FDM's distributive.

You might also like