Cool: that works -- Thanks.

Err. The examples ARE using ActionItems and ActionLists. See iTunes plugin for example.Sorry, my mistake. I was tired and wasn't thinking very well
All the documentation is in the first post.
In the meantime, i had a look on all the provided plugins and figured it out, and I must say, it is great! I wrote a plugin in half an hour!

The "contextmenu" addmenu command must be called at a very specific time, only after farr requests it from your plugin. This happens when your plugin received an AllowProcessTrigger call with triggermode=PrepareContextMenu.How can I answer that call?
FARR will do a plugin->set_strvalue("pcommand",EXTRA_TEXT) call to the plugin. Now, how can I catch that call?
The "contextmenu" addmenu command must be called at a very specific time, only after farr requests it from your plugin. This happens when your plugin received an AllowProcessTrigger call with triggermode=PrepareContextMenu.
Allow_ProcessTriggerV2(const char* destbuf_path, const char* destbuf_caption, const char* destbuf_groupname, int pluginid,int thispluginid, int score, E_EntryTypeT entrytype, void* tagvoidp, BOOL *closeafterp, int triggermode);
where triggermode is E_AllowProcessTriggerMode_PrepareContextMenu=2
public FARRTrayList(FARRCSharpPluginBase pluginBase)
: base(pluginBase, "^tray")
{ EnumTray.GetTrayData(out buttonData); // populate tray data
foreach (TrayIconData trayData in buttonData)
{
if (trayData.button.fsState != 8) // only add if button is not invisible
SourceList.Add(new Actions.FARRTrayAction(trayData, m_TempPath));
//if (this.Count > 10)
// break;
}
}now in order to do that, you NEED the new farr callback which was recently added (and is not yet in the C# api but i have on good authority it will be added soon)Now, that's all that I needed

and then in your set_strvalue(name,value) event function that gets called by farrThis one is for vitalyb: what is the function(method) name in c# sdk that I need to override to catch this call or is it not yet implemented?
If I put it in GetActionsCount it doesn't work. That's ok though. However, on executing a result, it does nothing except hide FARR. I have a simple MessageBox.Show() string printed at the moment (in Execute()), but the MessageBox doesn't show?

static string m_TempPath = null;
public FARRTrayList(FARRCSharpPluginBase pluginBase)
: base(pluginBase, "^tray")
{
m_TempPath = Path.Combine(System.IO.Path.GetDirectoryName(Assembly.GetCallingAssembly().Location), "Temp");
Directory.CreateDirectory(m_TempPath);
string[] Files = Directory.GetFiles(m_TempPath);
foreach (string FileName in Files)
{
File.Delete(FileName);
}
EnumTray.GetTrayData(out buttonData); // populate tray data
foreach (TrayIconData trayData in buttonData)
{
if (trayData.button.fsState != 8) // only add if button is not invisible
SourceList.Add(new Actions.FARRTrayAction(trayData, m_TempPath));
//if (this.Count > 10)
// break;
}
}EnumTray.GetTrayData(out buttonData);
foreach (TrayIconData trayData in buttonData)
{
if (trayData.button.fsState != 8) // only add if button is not invisible
SourceList.Add(new Actions.FARRTrayAction(trayData, m_TempPath));
//if (this.Count > 10)
// break;
}each time I execute the plugin by typing in it's regex.

class FARRTrayList : ActionsList
{
private TrayIconData[] buttonData = null;
static string m_TempPath = null;
public FARRTrayList(FARRCSharpPluginBase pluginBase)
: base(pluginBase, "^tray")
{
m_TempPath = Path.Combine(System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Temp");
Directory.CreateDirectory(m_TempPath);
//SourceList.Add(new Actions.FARRTrayAction(null, m_TempPath));
//SourceList.Add(new Actions.FARRTrayAction(this.PluginBase));
}
public override int GetActionsCount(string KeyKeywords)
{
MessageBox.Show("In GAC, m_TempPath = " + m_TempPath);
string[] Files = Directory.GetFiles(m_TempPath);
MessageBox.Show(Files.Length.ToString());
foreach (string FileName in Files)
{
MessageBox.Show("Deleting file: " + FileName.ToString());
File.Delete(FileName);
}
EnumTray.GetTrayData(out buttonData); // populate tray data
if (buttonData != null)
{
foreach (TrayIconData trayData in buttonData)
{
if (trayData.button.fsState != 8)
{ // only add if button is not invisible
MessageBox.Show("Found tray app: " + trayData.Text);
SourceList.Add(new Actions.FARRTrayAction(trayData, m_TempPath));
}
if (SourceList.Count > 10)
break;
}
MessageBox.Show("IN GAC, with data count: " + SourceList.Count);
return SourceList.Count;
}
else
{
MessageBox.Show("IN GAC, with no data count");
return 0;
}
}
} EnumTray.GetTrayData(out buttonData); // populate tray data
if (buttonData != null)
{
foreach (TrayIconData trayData in buttonData)
{
if (trayData.button.fsState != 8)
{ // only add if button is not invisible
MessageBox.Show("Found tray app: " + trayData.Text);
SourceList.Add(new Actions.FARRTrayAction(trayData, m_TempPath));
}
if (SourceList.Count > 10)
break;
}
MessageBox.Show("IN GAC, with data count: " + SourceList.Count);
return SourceList.Count;
}without the msgboxes of course, does work as expect when placed in the constructor, except then it is not dynamic. The results will show however, unlike when in GAC. Hopefully I'm just missing something very simple. public override int GetActionsCount(string KeyKeywords)
{
reloadClippings(); // loads the SourceList
KeyKeywords = GetSearch(KeyKeywords); // strips plugin regex from the input sting
this.ClearTemporaryItems();
foreach (Actions.ClipboardAction Item in SourceList)
{
if (Item.Caption.ToLower().Contains(KeyKeywords))
this.Add(Item);
}
return this.Count;
}
public override int GetActionsCount(string KeyKeywords)
{
string[] Files = Directory.GetFiles(m_TempPath); // remove temp icon files
foreach (string FileName in Files)
File.Delete(FileName);
SourceList.Clear();
EnumTray.GetTrayData(out buttonData); // populate tray data
if (buttonData != null)
{
foreach (TrayIconData trayData in buttonData) // fill SourceList
{
if (trayData.button.fsState != 8) // only add if button is not invisible
SourceList.Add(new Actions.FARRTrayAction(trayData, m_TempPath));
if (SourceList.Count > 10)
break;
}
this.ClearTemporaryItems();
foreach (Actions.FARRTrayAction item in SourceList) // Copy SourceList to thisList
this.Add(item);
return this.Count;
}
else return 0;
}

Original address: https://www.donationcoder.com/forum/index.php?topic=10992.0