Poor man's tabbed Salamander (freeware)
Poor man's tabbed Salamander (freeware)
Hi all,
I'm working on a little utility I have called SalShell (Salamander Shell). It is basically a container, with tabs, that will house multiple instances of Servant Salamander within the one window. This will allow quick change between Salamander sessions, as well as drag and drop between tabs/instances.
I was basically writing it for myself but thought some others might find it useful. It is not finished yet but I wanted to post a screenshot and see what you think and whether it is worth my while tidying it up a bit and finishing it properly.
It might be useful until we get true tabbed browsing implemented within Servant Salamander.
thanks
John
I'm working on a little utility I have called SalShell (Salamander Shell). It is basically a container, with tabs, that will house multiple instances of Servant Salamander within the one window. This will allow quick change between Salamander sessions, as well as drag and drop between tabs/instances.
I was basically writing it for myself but thought some others might find it useful. It is not finished yet but I wanted to post a screenshot and see what you think and whether it is worth my while tidying it up a bit and finishing it properly.
It might be useful until we get true tabbed browsing implemented within Servant Salamander.
thanks
John
-
- ALTAP Staff
- Posts: 5231
- Joined: 08 Dec 2005, 06:34
- Location: Novy Bor, Czech Republic
- Contact:
-
- Posts: 593
- Joined: 09 Dec 2005, 17:30
- Location: a step further
- Contact:
Are you using (similar) constructs (here for ObjectPascal)?
var
Wnd : HWND;
begin
WinExec('notepad', SW_Show);
Wnd := FindWindow('notepad', nil);
if Wnd <> 0 then begin
Windows.SetParent(Wnd, Handle);
MoveWindow(Wnd, 0, 0 ,ClientWidth, ClientHeight, False);
SetForegroundWindow(Wnd);
end;
end;
I was playing with this, but I have problems with memory (a lot of running instances of SS) and also with configuration saving, and some others as you can imagine.
Or are you using some more "smart" way (if the idea isn't secret)?
var
Wnd : HWND;
begin
WinExec('notepad', SW_Show);
Wnd := FindWindow('notepad', nil);
if Wnd <> 0 then begin
Windows.SetParent(Wnd, Handle);
MoveWindow(Wnd, 0, 0 ,ClientWidth, ClientHeight, False);
SetForegroundWindow(Wnd);
end;
end;
I was playing with this, but I have problems with memory (a lot of running instances of SS) and also with configuration saving, and some others as you can imagine.
Or are you using some more "smart" way (if the idea isn't secret)?
Jiri {x2} Cincura
Plus... this looks to me like a very good generic tool, not just for Salamander.
Many years ago I found (on the web) an example for sub-classing applications into a user's program window with Visual Basic, but lost the source for it.
Maybe such a tool is already "out there"?
Many years ago I found (on the web) an example for sub-classing applications into a user's program window with Visual Basic, but lost the source for it.
Maybe such a tool is already "out there"?
Mouse-centric, Registered
SalShell
Hi cincura.net, Tomcat and others...
How did you know it was Delphi (the horrible default icon)?
Happy to make it open source, it's no big secret and it's not actually that difficult.
It is written in Delphi 7 (but should work with pretty much any version of Delphi). I am not using WinExec, I am using CreateProcess, that gives a bit more control over the launching of the app.
It uses one freeware Delphi component which simplifies the creation and running of the Salamander process. It uses the Servant Salamander windows class (which is "SalamanderMainWindowVer16"), launches the app, waits for the app to go "idle", then reparents Salamander into a new tab. It doesn't really need to subclass Salamander, but I will. This will allow a bit of extra functionality such as changing the tab captions to match the Salamander window caption. It will also allow me to pick up a keystroke combination within Salamander and use that to switch between tabs. For example, the hotkey to go to the next tab in SalShell is CTRL+N, if Salamander has the focus and it is not subclassed, then I have no way of detecting that keystroke combination.
The resizing of the Salamander windows is done with SalShell. Salamander runs "full screen" within each tab, so when you resize SalShell (by dragging or maximising), you just send a "resize" message to each Salamander instance and they will fill the tab.
One point to note:
1. I think the Salamander option of "Save on Exit" should be turned off. I think it may cause problems if Salamander saves it settings on exit, and you have 4 or 5 of them running at once, and they all close at much the same time when closing SalShell.
And yes, I guess it could be made generic to work with other stuff (notepad, windows explorer etc, but I might leave that to some other bright spark).
How did you know it was Delphi (the horrible default icon)?
Happy to make it open source, it's no big secret and it's not actually that difficult.
It is written in Delphi 7 (but should work with pretty much any version of Delphi). I am not using WinExec, I am using CreateProcess, that gives a bit more control over the launching of the app.
It uses one freeware Delphi component which simplifies the creation and running of the Salamander process. It uses the Servant Salamander windows class (which is "SalamanderMainWindowVer16"), launches the app, waits for the app to go "idle", then reparents Salamander into a new tab. It doesn't really need to subclass Salamander, but I will. This will allow a bit of extra functionality such as changing the tab captions to match the Salamander window caption. It will also allow me to pick up a keystroke combination within Salamander and use that to switch between tabs. For example, the hotkey to go to the next tab in SalShell is CTRL+N, if Salamander has the focus and it is not subclassed, then I have no way of detecting that keystroke combination.
The resizing of the Salamander windows is done with SalShell. Salamander runs "full screen" within each tab, so when you resize SalShell (by dragging or maximising), you just send a "resize" message to each Salamander instance and they will fill the tab.
One point to note:
1. I think the Salamander option of "Save on Exit" should be turned off. I think it may cause problems if Salamander saves it settings on exit, and you have 4 or 5 of them running at once, and they all close at much the same time when closing SalShell.
And yes, I guess it could be made generic to work with other stuff (notepad, windows explorer etc, but I might leave that to some other bright spark).
When terminating SalShell you should terminate one Salamander instance after the other waiting for each to terminate before you start to close the next. The one that had the focus should be last.
Or, if possible, even better, turn off saving for all but the one that has focus.
Further thought should be given to saving plugin's configuration (not all might be loaded in all instances of Salamander) and to the case where autosaving configuration was turned on or off in some of the instances manualy (which I do when I want to make some temporary or persistent changes to the configuration while more than one instance of Servant Salamander is running (which is standard on my systems)).
Or, if possible, even better, turn off saving for all but the one that has focus.
Further thought should be given to saving plugin's configuration (not all might be loaded in all instances of Salamander) and to the case where autosaving configuration was turned on or off in some of the instances manualy (which I do when I want to make some temporary or persistent changes to the configuration while more than one instance of Servant Salamander is running (which is standard on my systems)).
-
- ALTAP Staff
- Posts: 5231
- Joined: 08 Dec 2005, 06:34
- Location: Novy Bor, Czech Republic
- Contact:
I see several problems here. The main window of SS will not be happy from this cage It relies on some messages that are delivered only to the top level windows. Also activation messages handling (WM_NCACTIVATE and WM_ACTIVATE) is very tricky in SS.
So, it can "somehow" work, but be prepared to problems you don't know now...
Also I hope this will not complicate our Bug Reports handling. We are walking through bug reports from our users, trying to fix repetitive problems. If some problems will be introduced by this shell, we will hunt non-existing bugs...
So, it can "somehow" work, but be prepared to problems you don't know now...
Also I hope this will not complicate our Bug Reports handling. We are walking through bug reports from our users, trying to fix repetitive problems. If some problems will be introduced by this shell, we will hunt non-existing bugs...
Thanks Jan
Ok, understood. So far so good but we'll see what happens...
Thanks Jan
Hi Jan, Thanks for that info. I would hate to introduce problems by this that meant you spending your valuable time looking into. As I said, this was just going to be for my own use and I only mentioned it here as I thought it might provide some benefit for others too. If you think there is some risk with this then I am happy to leave things be.
John
John