Plug-in Reference — Inline Functions — Editor_ExecPlugin

# Editor_ExecPlugin

Executes a specified plug-in. You can use this inline function or explicitly send the EE_EXEC_PLUGIN message.

HRESULT Editor_ExecPlugin( HWND hwnd, LPCWSTR pszName, LONG nFlags, WPARAM wParam, LPARAM lParam, LONG_PTR* pnResult );

## Parameters

hwnd

Specifies the window handle of the view or frame of EmEditor.

pszName

Specifies the plug-in file name.

nFlags

Specifies a combination of the following values. PLUGIN_FLAG_EXEC_COMMAND, PLUGIN_FLAG_USER_MSG, and PLUGIN_FLAG_QUERY_STATUSmust be mutually exclusively specified.

PLUGIN_FLAG_EXEC_COMMAND | Runs the plug-in as if a user selected the plug-in command. The wParam and lParam parameters are ignored when this is specified.
PLUGIN_FLAG_USER_MSG | Sends a message to the plug-in using the wParam and lParam parameters.
PLUGIN_FLAG_QUERY_STATUS | Retrieves the plug-in status. The wParam and lParam parameters are ignored when this is specified.
PLUGIN_FLAG_ABSOLUTE_PATH | The pszName contains the full path to the file. If this flag is not specified, the plug-in must exist in the default plug-in folder, which is PlugIns subfolder of the EmEditor install folder.

wParam

Specifies the first parameter to send to the plug-in. The meaning of the parameter depends on each plug-in.

lParam

Specifies the second parameter to send to the plug-in. The meaning of the parameter depends on each plug-in.

## Return Values

The return value is a negative value If an error occurs. Otherwise, if PLUGIN_FLAG_EXEC_COMMAND is specified, the return value is 0. If PLUGIN_FLAG_USER_MSG is specified, the meaning of the return values depends on each plug-in. If PLUGIN_FLAG_QUERY_STATUS is specified, the method returns a combination of the following values.

STATUS_ENABLED | The plug-in is enabled.
STATUS_LATCHED | The plug-in is checked.

## Version

Supported on EmEditor Professional Version 15.5 or later.