Page 1 of 2

Single instance

Posted: 09 May 2008 12:49
by alexey_r
There is an option to always open a new instance in Configuration/Startup & Exit.

Could you add an option to only have a single instance?

Re: Single instance

Posted: 11 May 2008 08:17
by admin
alexey_r wrote:There is an option to always open a new instance in Configuration/Startup & Exit.

Could you add an option to only have a single instance?
But for what reason? I think it's a plus to be able to have as many parallel instances as you like. Why constrain that?

Re: Single instance

Posted: 11 May 2008 09:35
by alexey_r
admin wrote:But for what reason? I think it's a plus to be able to have as many parallel instances as you like. Why constrain that?
Because I prefer to use tabbed applications (Firefox, (effectively) Emacs) in a single-instance mode, and remember their last state. I don't want to worry about closing the correct instance last to save its state and not that of another instance. Before changing shortcuts I regularly ended up with several instances when I didn't particularly want this, because the original instance was minimized to tray and hidden. (And of course on reboot the minimized instance kindly saved its state, overriding the tabs open in the instance I had actually been working in.)

For that matter, if I do want to open a new instance, it would be just a single additional step to uncheck the option.

At the moment I have added a startup path to the shortcut in the Start Menu and created a copy of the original shortcut called XYplorer New Instance, in case I need it.

Posted: 16 May 2008 22:58
by wc96
there's a little script in AHK you can use to mimic single instance:


#o::
SetTitleMatchMode 2
If WinExist("ahk_class ThunderRT6FormDC")
{
WinActivate
}
else
{
Run, D:\util\XYplorer\XYplorer.exe
}
return

Posted: 17 May 2008 07:57
by alexey_r
I used this script, from the wiki:

#x::
DetectHiddenWindows, On
SetTitleMatchMode, 2
IfWinExist XYplorer
{
WinActivate
}
else
{
Run E:\XYplorer\XYplorer.exe
WinWait XYplorer
WinActivate
}
RETURN

Unfortunately, it often didn't work.

Your version, however, does. Thank you!

Posted: 20 May 2008 11:36
by lukescammell
Thanks for this, it's excellent! I humbly suggest a small alteration to the script that should enable you to have this work no matter what drive you are running XY from. If you keep your .ahk file in the same directory as XYplorer.exe, removing the file path in the AHK script before XYplorer.exe should do the trick!

I've tried this from both my portable drive and the local machine desktop and it appears to work. Also, I prefer Win+X as the hotkey, so I've changed it to that as well (#x in the first line) but it can be changed to whatever anyone else likes!

Code: Select all

#x::
SetTitleMatchMode 2
If WinExist("ahk_class ThunderRT6FormDC")
{
    WinActivate
}
else
{
    Run, XYplorer.exe
}
return

Posted: 22 May 2008 18:31
by Jeeves
I wish it had a single instance mode too. That's the sheer reason I use tabs.

I also use AutoHotkey and wanted to remap the Win+E key, here's my script:

Code: Select all

#e:: 
SetTitleMatchMode,2 
IfWinExist,  - XYplorer @ 
{ 
WinRestore,  - XYplorer @ 
WinActivate 
} 
else 
Run, "C:\Program Files\XYplorer\XYplorer.exe" 
WinRestore, - XYplorer @ ahk_class ThunderRT6FormDC 
WinActivate 
return
It's not perfect, but if XYplorer isn't running, it'll start it. If it is running, it'll restore the window.

I can't claim the title string matches will work for everyone, but in my usage it didn't seem that the string:

Code: Select all

 - XYPlorer @ 
ever changed.

Edit: Seems that XYplorer hides it's window if it's set to "minimize to tray" so, the script doesn't work correctly with the windowhidden. Telling AHK to 'DetectHiddenWindows' prevents XYplorer from re-minimizing to the tray... Still workin'...

Posted: 01 Jun 2008 18:44
by peterbonge
Jeeves wrote:I wish it had a single instance mode too. That's the sheer reason I use tabs.
...
Same here.

I don't understand why there isn't an option for. My understanding of using tabs: Avoid running multiple instances and cluttering the task bar.

So please add an option "Allow multiple instances" and make it off by default. That would be just logical.

Posted: 04 Jun 2008 09:46
by admin
peterbonge wrote:
Jeeves wrote:I wish it had a single instance mode too. That's the sheer reason I use tabs.
...
Same here.

I don't understand why there isn't an option for. My understanding of using tabs: Avoid running multiple instances and cluttering the task bar.

So please add an option "Allow multiple instances" and make it off by default. That would be just logical.
You know what, I did it! 8)

Posted: 04 Jun 2008 20:41
by peterbonge
admin wrote:...
You know what, I did it! 8)
And it works great :D
Thanks!

Posted: 05 Jun 2008 03:45
by Jeeves
Just pulled down the beta, works fantastic. THANK YOU!

oh no...

Posted: 14 Jun 2008 13:34
by itsme28m
Yeah great, and now i even don't have the option anymore to allow multiple instances, what i need! :shock:

Because of this i have to go back to total commander for a while :(.

Edit: i need multiple instances for 2 reasons:
-no dual pane in xyplorer
-the search list always renews if you go to another tab and back to the search list.

Those 2 problems could be minimized with multiple instances of xyplorer, now xyplorer locks me completely with those problems. :shock:

Re: oh no...

Posted: 14 Jun 2008 16:01
by j_c_hallgren
itsme28m wrote:Yeah great, and now i even don't have the option anymore to allow multiple instances, what i need! :shock:
:? Huh? As a test, I've got two separate sessions of XY running right now...

I had to set the "Allow multiple" and "Open New always" in Start/Exit config first...

But I DID notice a problem: The second session has these set OFF, yet I'm using the same INI, so I can't get a third session going..

It's just not possible with me...

Posted: 14 Jun 2008 16:54
by itsme28m
Hi,

I hoped i could do thesame thing as you... i had set the "Allow multiple" and "Open New always" options more then 12 times now with closing and opening xyplorer multiple times. Every time i closed and reopened xyplorer the options where disabled again!

Even after i did a file, settings, save configuration and repeted the steps again.

The problem with me is worse... i can't get a second session whatever i try.

I'm on windows xp, so can't be admin rights (and then it wouldn't work before either, i just have this problem with 7.20.0000 version. If this gets fixed in a beta version then i would install a beta version for the first time ever :o

Re: It's just not possible with me...

Posted: 14 Jun 2008 17:03
by j_c_hallgren
itsme28m wrote:Every time i closed and reopened xyplorer the options where disabled again!

Even after i did a file, settings, save configuration and repeted the steps again.

i just have this problem with 7.20.0000 version. If this gets fixed in a beta version then i would install a beta version for the first time ever :o
:? Humm....not sure what issue is...and there isn't anything in 7.20.01 that relates to this that I see...but I've only had one major issue with a beta in 2 1/2 yrs, so I think they're very safe to use!

Alright...now, how about as experiment using NotePad to set the "AlwaysNewInstance=1" and then starting XY and see what happens?