Please note that multiple Lister windows can be open at the same time! Therefore you cannot save settings in global variables. You can call RegisterClass with the parameter cbWndExtra to reserve extra space for your data, which you can then access via GetWindowLong(). Or use an internal list, and store the list parameter via SetWindowLong(hwnd,GWL_ID,...).
Lister will subclass your window to catch some hotkeys like 'n' or 'p'.
When lister is activated, it will set the focus to your window. If your window contains child windows, then make sure that you set the focus to the correct child when your main window receives the focus!
poiuytr, do you know what does first red selction mean?
Do I need to "subclass" plugin window in my loader?
How to do it?
And 2nd selction: do I need to put focus on plugin window?
2ghisler(Author)
The main problem with plugins keys handling is: when plugin (e.g. SynPlus.wlx) is started, it doesn't react to arrow keys (but reacts to PgUp/PgDn). The same is with office.wlx. It seems my form gets arrow keys before plugins, and plugins don't. Is the problem in subclassing?
You are right, I have KeyPreview set to ON. In FormKeyDown, I check for vk_up, vk_down etc. and send WM_VSCROLL to my own window. However, I checked in the debugger but none of my functions is called while SynPlus is active!
I suggest that you send your tool to the SynPlus author and ask him why it doesn't work...
In FormKeyDown, I check for vk_up, vk_down etc. and send WM_VSCROLL to my own window.
So if I don't do vk_up/ vk_down/ etc handling in FormKeyDown, plugin keys will not work? Can they work wihtout this handling?
Small note: keys become working in plugin after I show/hide other controls (not plugin) on Viewer form. But they don't work immeidately after Viewer start.
I suggest that you send your tool to the SynPlus author and ask him why it doesn't work...
SynPlus author is not resp. for this problem, because the same problem is with office.wlx and my own OOView.wlx...
Alextp wrote:2poiuytr
The same problem with arrow keys (see my post to Ghisler) is with your WLX loader. Can you help?
I can't figure out why it happens (focus jumps to my form when arrow keys pressed and I can't catch the trigger of this behaviour), but I found a condition for arrow keys to work as expected.
Just be sure that there are no focusable controls on your form. Personally I make all controls disabled and arrows works as expected inside plugins. Changing TabStop to false don't help here.
edit:
Oh yeah, there are sources in case you wanna try them.
Last edited by poiuytr on 2006-07-08, 16:58 UTC, edited 1 time in total.
2poiuytr
I found it! It was Viewer (component instance of type ATViewer) focused. Form has ActiveControl=Viewer, I just cleared this prop and all works now.
Another question:
when to put focus on plugin window. Of course, after ListLoad(). When else? E.g., we call some dialog ("Find text" in my Viewer) and plugin looses focus. So, we need to put focus explicitly after every dialog show? Not nice, there may be 20+ dialogs... Maybe, some better way can be, like changing focus in event handler?
How Christian do this?
----
2poiuytr
Are you Dmitrie Murzaikin, author of Tiny TC Restarter?
Yes, when lister gets a WM_ACTIVATE (with paramters "activate"), and a plugin is active, it sets the focus to the plugin window. You will need to do the same.
Alex, can this be downloaded somewhere. I always thought... why Viewer hold that ATView Delphi component when we all use some plugins for images and other popular formats....
This is the right thing to do... Excellent work. Don't forget to copy/paste the interface we did for the full Viewer.
Now, if Ghisler refuse to update API, this can be implemented:
Make a screen capture of lister and display it as a bitmap which is then hidden after the next plugin has loaded