I have just started writing plugins for FAR, after switching to the x64 unicode version and finding many of the plugins i've been using for years no longer work (and aren't being updated)... so at long last I have to get my hands dirty and make some of my own...
While working on a folder manager (kind of an all-in-one folder shortcut system), I've now run into a problem to which I can not seem to find a solution, even after examining tons of example code (some old, some new)...I must be missing something as this should be an easy thing to do...
What I'm trying to do is simple: I add an entry to the Drive Menu and when that entry is selected, the FILE PANE FOR WHICH THE DRIVE MENU WAS SHOWN (ie. left if ALT+F1, right if ALT+F2) should change to some directory. The setup and interception of the selection is very straightforward and it's all working. I respond to the selection in the OpenPluginW() function, but all it gives me is whether the selection was made from the Drive Menu, and the index of the selected item. What it does NOT provide me with, and what I sorely need, is a handle (or something) to the panel for which the drive menu was shown. Then I could use the Control( handle, FCTL_SETPANELDIR, 1, L"D:\SomePath" ) to set the path for the correct panel.
So in short, what I need is the following:
1) A way to determine for which panel (left/right) or (active/passive) the drive menu was shown when a selection is made (in/before the OpenPluginW() function).
2) and if the panel is (left/right), not (active/passive), then a way to change the directory of that panel (ie. not using PANEL_ACTIVE/PANEL_PASSIVE).
So far, the only reference I found in the Encyclopedia to something like this was the Macro Command "Drv.ShowPos". But even if I were to use this, it would only give me a numeric value indicating the left/right panel (as 1 or 2) and I would still have no way of referring to that panel.
Any help would be greatly appreciated.
BTW: I'm running Far 2.0 b1081 x64 and using the C Plugin API in Visual Studio 2008.
Panel For Which the Drive Menu is Shown?
- NightRoman
- Posts: 6184
- Joined: Fri 18 Aug, 2006 13:52
- Location: Cambridge, UK
- Has thanked: 32 times
- Been thanked: 62 times
- Contact:
Re: Panel For Which the Drive Menu is Shown?
Take a look at the panel flag PFLAGS_PANELLEFT. As far as you know where the disk menu is shown (1/2) then you can conclude what panel (active or passive) you should use depending on this flag.
Re: Panel For Which the Drive Menu is Shown?
Thanks alot Roman, I somehow missed that flag (maybe cause it's last in the help)..anyway it works like a charm and that takes care of the second problem, now I know which side is active
however, i still can't figure out how to detect which side the drive menu is show (or even where to detect it, since by the time OpenPluginW() is called it's already closed) - the only other way i can think of now is to try and intercept the key combination (ALT+F1/F2) and save that in a global somewhere...but there has to be a better way.
however, i still can't figure out how to detect which side the drive menu is show (or even where to detect it, since by the time OpenPluginW() is called it's already closed) - the only other way i can think of now is to try and intercept the key combination (ALT+F1/F2) and save that in a global somewhere...but there has to be a better way.
-
- Posts: 1
- Joined: Tue 08 Mar, 2011 12:43
- Contact:
Re: Panel For Which the Drive Menu is Shown?
If no update that means their are all working well )free3dom wrote:I have just started writing plugins for FAR, after switching to the x64 unicode version and finding many of the plugins i've been using for years no longer work (and aren't being updated)... so at long last I have to get my hands dirty and make some of my own...