Single instance

Features wanted...
alexey_r
Posts: 12
Joined: 16 Mar 2008 18:38
Contact:

Single instance

Post 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?
Alexey Romanov

admin
Site Admin
Posts: 65185
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Single instance

Post 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?

alexey_r
Posts: 12
Joined: 16 Mar 2008 18:38
Contact:

Re: Single instance

Post 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.
Alexey Romanov

wc96
Posts: 32
Joined: 23 Apr 2008 22:34

Post 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

alexey_r
Posts: 12
Joined: 16 Mar 2008 18:38
Contact:

Post 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!
Alexey Romanov

lukescammell
Posts: 744
Joined: 28 Jul 2006 13:15
Location: Kent, UK
Contact:

Post 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
Used to update to the latest beta every day. Now I have children instead…
Windows 10 Pro x64 (everywhere except phone…)

Jeeves
Posts: 123
Joined: 15 May 2008 07:57

Post 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'...

peterbonge
Posts: 363
Joined: 25 May 2004 21:53

Post 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.
Regards,
Peter Bonge

My System:
Windows 11 Pro, 64-bit, German

admin
Site Admin
Posts: 65185
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Post 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)

peterbonge
Posts: 363
Joined: 25 May 2004 21:53

Post by peterbonge »

admin wrote:...
You know what, I did it! 8)
And it works great :D
Thanks!
Regards,
Peter Bonge

My System:
Windows 11 Pro, 64-bit, German

Jeeves
Posts: 123
Joined: 15 May 2008 07:57

Post by Jeeves »

Just pulled down the beta, works fantastic. THANK YOU!

itsme28m
Posts: 124
Joined: 03 Sep 2006 16:49
Location: Belgium

oh no...

Post 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:

j_c_hallgren
XY Blog Master
Posts: 5826
Joined: 02 Jan 2006 19:34
Location: So. Chatham MA/Clearwater FL
Contact:

Re: oh no...

Post 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..
Still spending WAY TOO much time here! But it's such a pleasure helping XY be a treasure!
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.

itsme28m
Posts: 124
Joined: 03 Sep 2006 16:49
Location: Belgium

It's just not possible with me...

Post 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

j_c_hallgren
XY Blog Master
Posts: 5826
Joined: 02 Jan 2006 19:34
Location: So. Chatham MA/Clearwater FL
Contact:

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

Post 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?
Still spending WAY TOO much time here! But it's such a pleasure helping XY be a treasure!
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.

Post Reply