Opening a lister in a new Win 10 Virtual Desktop using DOpusRT

In Quick Access Popup, I'm using DOpusRT to open a folder in a new lister. Depending on the options selected by QAP user, the lister will be open with a command like:

"C:\Program Files\GPSoftware\Directory Opus\dopusrt.exe" /acmd Go "E:" NEWTAB=tofront OPENINLEFT

The issue is that if the user tries to open this folder in a new Win 10 Virtual Desktop (created with Win+Ctrl+D), the lister is added to the instance of DOpus already running in the first (main) desktop instead if in the new desktop.

I searched the forum on this but found nothing. Is there a DOpusRT option that would instruct it to launch a new instance of DOpus in the Virtual Desktop?

Thanks.

If you replace NEWTAB=tofront with NEW, it would open a new window on the current desktop.

The question then becomes how to know when to do it. But there's also the possibility that there is an existing window on the current desktop, and it isn't the last-active window, which complicates things further, assuming you would want the tab to open in that window rather than a brand new one.

We could probably provide a way to send the command to a particular lister by its window handle, which would cover all situations, I think, as long as you don't mind enumerating the listers and finding the one you want, based on which desktops they are on.

We could also probably add a new alternative to /cmd and /acmd which only consider windows on the current desktop. That might be easier for you, although would also give you less control over what happens, which may make it less useful for other situations.

Hi Leo. Thanks for your quick and thoughtful reply. I'll take some time to analyse this and get back to you.

Jean

Hi Leo,

I'm reactivating this old thread. In your last message, you proposed 3 options. The 1st one is problematic as your mentioned.

About option 2:

We could probably provide a way to send the command to a particular lister by its window handle, which would cover all situations, I think, as long as you don't mind enumerating the listers and finding the one you want, based on which desktops they are on.

Not sure how I would enumerate the listers on a specific desktop?

Now about option 3:

We could also probably add a new alternative to /cmd and /acmd which only consider windows on the current desktop. That might be easier for you, although would also give you less control over what happens, which may make it less useful for other situations.

This seems to be an easier alternative for me if you can add this. Currently, in QAP, I always use the /aCmd command. This new command would have to replicate the behavior of /aCmd but restricted on the current desktop.

As you can see, there is no emergency here. Thanks for considering this.

Enumerate them normally, and filter out the ones where IsWindowOnCurrentVirtualDesktop returns false.

Should be easy enough, although if there was no window on the current virtual desktop, it would have to end up routing the command to a window on another desktop (if there is one, of course). So you would probably still want to enumerate the windows to find out if any suitable ones exist, and change the command you run if there are none (e.g. to open a new window on the current desktop).

I've implemented something that seems to work.

Currently, before opening a folder using DOpusRt, QAP checks if DOpus is running with the AutoHotkey command WinExist("ahk_class dopus.lister") that returns true if DOpus is running on any Windows 10 Virtual Desktop.

I replaced WinExist with AHK command WinGet, strWinIDs, List that retrieves the IDs of the existing windows on the current VD. If a DOpus lister appears in this list (class "dopus.lister"), I check if it runs on the current VD with the AHK function IsWindowOnCurrentVirtualDesktop() found here Windows 10 - How to distinguish between "visible" and "invisible" windows. - AutoHotkey Community. So far, so good...

This brings another issue that I'll raise in another thread:

1 Like