View Issue Details

IDProjectCategoryView StatusLast Update
0003314Far ManagerPlugins APIpublic2016-09-28 13:49
ReporterpepakAssigned To 
PrioritynormalSeverityfeatureReproducibilityalways
Status newResolutionopen 
Product Version3.0 
Target VersionFixed in Version 
Summary0003314: PluginsControl needs a simple method for calling plugins
DescriptionI can't find any easy way for my plugin to call another plugin. As far as I can tell, the only way I can reliably do it involves:

1) Find a plugin with PCTL_FINDPLUGIN.
2) Get its information with PCTL_GETPLUGININFORMATION.
3) If the plugin is loaded...
4) Use its ModuleName with LoadLibrary and GetProcAddress to get address of the OpenW function.
5) Prepare an OpenInfo structure with the necessary data.
6) Call OpenW.

I would appreciate a simpler method. While the above is universal, one doesn't usually need all the power of OpenW - a simple call to pass a command-line to a plugin would satisfy most needs. Particularly since that simple interface would let me run a native (non-plugin) command line as well, which is apparently not possible with the current API.
TagsNo tags attached.
Build

Activities

JohnDoe

2016-09-27 20:13

updater   bugnote:0014816

pepak wrote

a simple call to pass a command-line to a plugin would satisfy most needs.
MCTL_EXECSTRING + Plugin.Command

pepak

2016-09-27 21:31

reporter   bugnote:0014817

It was my understanding that this would require a plugin to support macro calls. Am I mistaken?

Can Plugin.Command be used to execute a command line in the context of standard (non-plugin) panel, too?

JohnDoe

2016-09-28 10:13

updater   bugnote:0014818

Last edited: 2016-09-28 10:13

View 2 revisions

pepak wrote

It was my understanding that this would require a plugin to support macro calls
Plugin.Call requires, Plugin.Command and Plugin.Menu don't

pepak wrote

Can Plugin.Command be used to execute a command line in the context of standard (non-plugin) panel, too?
All should behaves same as user input in command line

pepak

2016-09-28 11:07

reporter   bugnote:0014819

Plugin.Command works nicely, even though it only replaces steps 4-6 above. Thanks for the hint.

My second question was perhaps poorly formulated. What I meant is, is it possible to execute a command line not through a plugin, but through FAR Manager itself? The distinction being, "edit:<for /?" is a plugin command while "cd c:\windows" is a FAR command (possibly passed to the underlying operating system). Is there a special GUID for FAR itself? I tried all zeroes, but apparently that is not correct.

JohnDoe

2016-09-28 13:44

updater   bugnote:0014820

Last edited: 2016-09-28 13:49

View 3 revisions

pepak wrote

it only replaces steps 4-6 above.
I wonder why do you ever need steps 1..3
Plugin Id is constant, and you can find if it is loaded by analysing returned values of MCTL_EXECSTRING

pepak wrote

is it possible to execute a command line not through a plugin, but through FAR Manager itself?
It's not possible now.
But you can emulate user input with macro (MCTL_SENDSTRING).
Like this:
print "edit:<for /?"
Keys "Enter"


Issue History

Date Modified Username Field Change
2016-09-27 17:47 pepak New Issue
2016-09-27 20:13 JohnDoe Note Added: 0014816
2016-09-27 21:31 pepak Note Added: 0014817
2016-09-28 10:13 JohnDoe Note Added: 0014818
2016-09-28 10:13 JohnDoe Note Edited: 0014818 View Revisions
2016-09-28 11:07 pepak Note Added: 0014819
2016-09-28 13:44 JohnDoe Note Added: 0014820
2016-09-28 13:46 JohnDoe Note Edited: 0014820 View Revisions
2016-09-28 13:49 JohnDoe Note Edited: 0014820 View Revisions