Help Topics

Creating a Plugin

A plugin is located in the Plugins/ subfolder of your EditPlug installation path. Each plugin DLL file must be named with the prefix "plg" and the extension ".dll"

Many plugins have the source code available. See z505.com/editplug/plugins/ for downloads.

When EditPlug is first opened, all directories in the Plugin/ subfolder are searched and each plgFile.dll in each subfolder in Plugins/ is registered as a plugin in the Plugins main menu.

Plugins are loaded into EditPlug only when the user needs them. Therefore no plugins are automatically loaded unless the user has specified to automatically load certain plugins in the Environment Options dialog of EditPlug.

To show your plugin, export a plgShow function. The plgShow function is called each time the user tries to load the plugin. If the plugin is already loaded, plgShow should simply show the plugin window. If the plugin is not loaded, the plgShow function should create any windows first and then show them.

Call the epCreatePluginTab function if the plugin is a tabbed plugin on the right side of EditPlug in the Plug Panel.

To create a plugin your DLL must export a minimum of the following functions:

procedure plgSetId(id: HINST); cdecl;
Use this function to retrieve the plugin ID for your plugin. Set a global variable to capture the plugin ID in your DLL.
function plgShow: HWND; cdecl;
Use this function to create your plugin window and show it.
procedure plgWinFree; cdecl;
Use this function to cleanup your plugin window (free resources). If your plugin window is not freed this will cause EditPlug to be unstable with errors, so always remember to free any windows you created in plgShow().
function plgGetWinHandle: HWND; cdecl;
Use this function to return your main plugin window handle.