Single instance only

Discussion & Support for xplorer² professional

Moderators: fgagnon, nikos, Site Mods

eyals
Member
Member
Posts: 10
Joined: 2005 Apr 07, 09:51

Post by eyals »

Thanks, guys.
It's still kind of a patch, and it still doesn't work when I open a folder not through the xplorer2 icon, but it's one step closer.
Let's hope this wish gets a higher priority.
The developing folks can't seem to get to the bottom of this request, and it's a shame, because this tool is almost perfect.

BTW - autoit looks like an interesting utility!
User avatar
nikos
Site Admin
Site Admin
Posts: 16296
Joined: 2002 Feb 07, 15:57
Location: UK

Post by nikos »

Demetris wrote:bSingleWindow does not allow for this.
See also this new thread, started by gladely:
http://forum.zabkat.com/viewtopic.php?t=2910
i can't see how your autoit script does anything on top of bSingleWindow but anyway! :)
Whitman
Member
Member
Posts: 44
Joined: 2003 Aug 23, 01:14

Post by Whitman »

With bSingleWindow, if an xplorer2 window is already open and the user runs xplorer2 from a shortcut/hotkey etc the existing window isn't brought into focus.  The AutoIt script checks to see whether xplorer2 is already running, if it is, it simply brings the window to the front.
Demetris
Silver Member
Silver Member
Posts: 217
Joined: 2004 Jul 04, 17:18

Post by Demetris »

nikos,

Why? It works fine for me, regardless of bSingleWindow settings.
As you said recently, programmatically it makes no difference what shortcut x2 is started with.
I suppose the same is true about how its inactive window is activated: Alt+Tab, Taskbar, or an AutoIt script.

Whitman,

Nice editing! Now it is easier to use as a template (and one can rename xplorerLocation and xplorerArguments to, e.g., appLocation and appArguments).
The only thing missing is a way to work out automatically WinTitle; but maybe this is not possible.

eyals,

For me this script is anything but a patch. It can be used for any program, and it is not like it requires .NET Framework to run! Just a tiny engine (130kb) which allows you to customize and automate almost anything in Windows.

Opening folders is an independent, internal issue; it is not affected by the script, at least for me.

As for development, I trust that Nikos works on something more generally useful when he says there are more pressing priorities. This particular one is not very high in my wishlist either. Certainly, it is lower than the following:

1. Better search
2. Better, really deep, pane synchronization. For example, I have a USB keydrive that I use, among other things, to carry around standalone programs with their settings and everything (see here: http://www.kikizas.net/en/usbapps.html). From time to time, I want to synchronize the programs directory in the keydrive with the Program Files directory in my desktop computer, but only for subdirectories that are present in the keydrive. Of course, I want the synchronization to be deep. I have not found an easy way to do this in x2.
3. Faster reading of CD and DVD drives
4. A more compact manual (without leaving out any of the great information and tips)
5. Intuitive shortcuts for Pane style (if there are any left)
6. Undo (but maybe this isn't worth the trouble yet)
7. Automatic removal of the Register and Donate menu items and toolbar icons when you register
8. No flashing and trembling at startup (cannot find the right verbs) especially when many tabs are opened in each pane, as this is the first impression you get each time you start x2, and it can make you feel that the program is shaky in general.
9. Hotkey remapping, so as to change the unintuitive Ctrl+Alt+Arrow with the universal Ctrl+PageDown/PageUp. Or, better yet, making the latter default for tabs; the human mind cannot work like this: when you see tabs in Windows (in a browser, in System Properties etc.) you hit automatically Ctrl+PageUp/PageDown. And I think that the small percentage of experienced x2 users you use this for columns can easily change their habit.
10. All settings in additional tabs in Options. IMO, only very advanced, "At your own risk", settings should be hidden in the registry.

This for an impromptu wishlist. :)
User avatar
fgagnon
Site Admin
Site Admin
Posts: 3737
Joined: 2003 Sep 08, 19:56
Location: Springfield

Post by fgagnon »

Thanks Demetris,
Your script & AutoIt (with or without Whitman's edit) takes care of the external shortcut starting an unwanted addtional x2 instance (when I don't notice it's already open on the taskbar :oops: ).
& thanks (again) nikos, for bSingleWindow which addresses the internal-to-x2 cases.
:D
User avatar
nikos
Site Admin
Site Admin
Posts: 16296
Joined: 2002 Feb 07, 15:57
Location: UK

Post by nikos »

Demetris wrote:Better search
:shock:  :!:  :?:

Better, really deep, pane synchronization
i guess you're right here but x2 does its best while remaining in "file management" outset. What could work for you is instead of sync-ing do a full copy of the flash stick contents, using the copy option "overwrite newer else skip"

Faster reading of CD and DVD drives
i find cds the worst kind of medium, especially as the device drivers for windows are shite! But i wouldn't single out x2, all file managers struggle the same
User avatar
dpupello
Member
Member
Posts: 63
Joined: 2002 Feb 14, 15:47
Location: FL

Post by dpupello »

Demetris wrote:
when you see tabs in Windows (in a browser, in System Properties etc.) you hit automatically Ctrl+PageUp/PageDown
Actually, Control-Tab and Control-Shift-Tab appear to be a little more universal.  Why?

Go to Tools, Options in MS Word.  Once there, at least on my machine, Control-Tab and Control-Shift-Tab work, but Ctrl+PageUp/PageDown do not.

Also, the rocking Maxthon browser uses Control-Tab and Control-Shift-Tab to switch window tabs.

And lastly for instance in Ultraedit with muliple documents open, Control-Tab switches between them, whereas Ctrl+PageUp/PageDown does not.  (Yes this isn't a tabbed dialogue, but you get the picture).

Any tabbed dialogue -- including X2's own Options -- accepts Control-Tab and Control-Shift-Tab to my (admittedly limited) knowledge. :)

I had forgotten about Ctrl+PageUp/PageDown until you mentioned it, but it seems universal except for the couple examples above.  And Ctrl+PageUp beats Control-Shift-Tab any day! :D

Dennis
Demetris
Silver Member
Silver Member
Posts: 217
Joined: 2004 Jul 04, 17:18

Post by Demetris »

dpupello

Oops! :oops: You're right. Ctrl(+Shift)+Tab seems to be the universal one, or at least more universal. (But then, this is not free in x2 either.) I was carried away by some programs with tabbed interface I use quite a lot, mainly Firefox, SciTE, Crimson Editor and KeyNote.

It seems that, when Ctrl+PageDown/PageUp does it, Ctrl(+Shift)+Tab does it too. However, the reverse is not true.

nikos
nikos wrote:
Demetris wrote:Better search
:shock:  :!:  :?:
LOL. I really meant "more friendly", not more powerful. For some reason(s), I cannot get used to this, and I find myself using the Windows Search more often than I would think. I'll have to pinpoint the reason(s) and get back with a proper report.
nikos wrote:What could work for you is instead of sync-ing do a full copy of the flash stick contents, using the copy option "overwrite newer else skip"
Thanks for the tip. More convenient that what I have been using (xcopy with switches). Can it also produce a log of the files copied?

BTW, "Overwrite if newer, else skip" seems a bit confusing, although it can only mean one thing if you think about it. Why not use something like: "Only copy if target is older", or just add a balloon tip?
User avatar
nikos
Site Admin
Site Admin
Posts: 16296
Joined: 2002 Feb 07, 15:57
Location: UK

Post by nikos »

Can it also produce a log of the files copied
the log contains the files skipped
you'll have to keep the dialog open after the copy to check the log (there's an option for this)
MegaZapFan
Bronze Member
Bronze Member
Posts: 135
Joined: 2005 Jan 31, 20:03

Post by MegaZapFan »

I hope this isn't old news, but I very effectively limited X2 to one instance using AutoHotKey with the following code:

#e::
SetTitleMatchMode,1
IfWinExist, xplorer
{
WinActivate
WinRestore, xplorer
}
else
Run, "C:\Program Files\Xplorer2\xplorer2_UC.exe"
return


This allows Windows+E to either launch X2 if it's not running, or pop it up if it is.
Dumb all over, a little ugly on the side...
niehofk
New Member
Posts: 2
Joined: 2005 May 23, 10:45

Post by niehofk »

eyals wrote:...
and it still doesn't work when I open a folder not through the xplorer2 icon, but it's one step closer.
Let's hope this wish gets a higher priority.
The developing folks can't seem to get to the bottom of this request, and it's a shame, because this tool is almost perfect.

BTW - autoit looks like an interesting utility!
Setting the default Explorer shell to xplorer2 with this registry key:

Code: Select all

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\open\command]
@=""C:\\Program Files\\zabkat\\xplorer2\\x2.exe" "%1""
And using the slightly changed script:

Code: Select all

; Restore xplorer2 if running; else run. 
#NoTrayIcon 

$xplorerLocation = "C:\Program Files\zabkat\xplorer2\xplorer2_UC.exe" 
If $CmdLine[0]="0" then 
   $xplorerArguments = "C:" 
 
Else 
   $xplorerArguments = $CmdLine[1]
 
EndIf


$splitLocation = StringSplit($xplorerLocation, "") 
$procName = $splitLocation[UBound($splitLocation)-1] 
If ProcessExists($procName) Then 
   Opt("WinTitleMatchMode", 4) 
   WinActivate("classname=ATL:ExplorerFrame", "") 
Else 
   Run ($xplorerLocation & ' "' & $xplorerArguments & '"') 
;   MsgBox(0, "Warning!", ($xplorerLocation & ' "' & $xplorerArguments & '"'))

EndIf 
Exit
It will open xplorer2 when there is no instance running yet into a default folder. When clicking on a folder, with no instance running, it will open up xplorer2 into that specific folder.
When an instance IS running, it will switch to that instance.

The only thing missing in this program is clicking on a folder while X2 is already running, and adding a Tab to the existing instance....

I would suggest a command line parameter for Xplorer2 to pick up the running instance (If exists) and opening a new tab for every extra parameter given.

That would make it just perfect.

Cheers
User avatar
nikos
Site Admin
Site Admin
Posts: 16296
Joined: 2002 Feb 07, 15:57
Location: UK

Post by nikos »

adding a Tab to the existing instance
just set bSingleWindow to 2 as explained in registry.txt
niehofk
New Member
Posts: 2
Joined: 2005 May 23, 10:45

Post by niehofk »

nikos wrote: just set bSingleWindow to 2 as explained in registry.txt
aaah,
This is the solution.
Xplorer2.exe does actually add a new TAB to the existing instance BUT does not activate the existing instance.

By setting the bSingleWindow key to 2 and make the script run  Xplorer2.exe again with the parameter %1 and then activating it, does the trick!



Thanks a lot!

Code: Select all

; Restore xplorer2 if running; else run. 
#NoTrayIcon 

$xplorerLocation = "C:\Program Files\zabkat\xplorer2\xplorer2_UC.exe" 
If $CmdLine[0]="0" then 
   $xplorerArguments = "C:" 
 
Else 
   $xplorerArguments = $CmdLine[1]
 
EndIf


$splitLocation = StringSplit($xplorerLocation, "") 
$procName = $splitLocation[UBound($splitLocation)-1] 
If ProcessExists($procName) Then 
   Opt("WinTitleMatchMode", 4) 
   Run ($xplorerLocation & ' "' & $xplorerArguments & '"') 
   WinActivate("classname=ATL:ExplorerFrame", "") Else 
   Run ($xplorerLocation & ' "' & $xplorerArguments & '"') 

EndIf 
Exit
Cheers
carpediem
New Member
Posts: 1
Joined: 2005 May 16, 07:46

Post by carpediem »

niehofk wrote:
nikos wrote: just set bSingleWindow to 2 as explained in registry.txt
aaah,
This is the solution.
Xplorer2.exe does actually add a new TAB to the existing instance BUT does not activate the existing instance.

By setting the bSingleWindow key to 2 and make the script run  Xplorer2.exe again with the parameter %1 and then activating it, does the trick!



Thanks a lot!

Code: Select all

; Restore xplorer2 if running; else run. 
#NoTrayIcon 

$xplorerLocation = "C:\Program Files\zabkat\xplorer2\xplorer2_UC.exe" 
If $CmdLine[0]="0" then 
   $xplorerArguments = "C:" 
 
Else 
   $xplorerArguments = $CmdLine[1]
 
EndIf


$splitLocation = StringSplit($xplorerLocation, "") 
$procName = $splitLocation[UBound($splitLocation)-1] 
If ProcessExists($procName) Then 
   Opt("WinTitleMatchMode", 4) 
   Run ($xplorerLocation & ' "' & $xplorerArguments & '"') 
   WinActivate("classname=ATL:ExplorerFrame", "") Else 
   Run ($xplorerLocation & ' "' & $xplorerArguments & '"') 

EndIf 
Exit
Cheers
This is EXACTLY the behavior I want from xplorer2 too. Thanks for the information and code guys. Changed my shortcut on the desktop to point to x2.exe too and now it's absolutely perfect :)
Revo
Member
Member
Posts: 9
Joined: 2005 Jun 18, 16:33

Post by Revo »

niehofk wrote:
nikos wrote: just set bSingleWindow to 2 as explained in registry.txt
aaah,
This is the solution.
Xplorer2.exe does actually add a new TAB to the existing instance BUT does not activate the existing instance.

By setting the bSingleWindow key to 2 and make the script run  Xplorer2.exe again with the parameter %1 and then activating it, does the trick!



Thanks a lot!

Code: Select all

; Restore xplorer2 if running; else run. 
#NoTrayIcon 

$xplorerLocation = "C:\Program Files\zabkat\xplorer2\xplorer2_UC.exe" 
If $CmdLine[0]="0" then 
   $xplorerArguments = "C:" 
 
Else 
   $xplorerArguments = $CmdLine[1]
 
EndIf


$splitLocation = StringSplit($xplorerLocation, "") 
$procName = $splitLocation[UBound($splitLocation)-1] 
If ProcessExists($procName) Then 
   Opt("WinTitleMatchMode", 4) 
   Run ($xplorerLocation & ' "' & $xplorerArguments & '"') 
   WinActivate("classname=ATL:ExplorerFrame", "") Else 
   Run ($xplorerLocation & ' "' & $xplorerArguments & '"') 

EndIf 
Exit
Cheers
Yes! thank you! although its a bit more complicated then I'd like I suppose I could play around with auto-it for a while thanks again.