Get active/inactive panel folders to clipboard

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
notabot
Posts: 59
Joined: 24 Feb 2021 12:34

Get active/inactive panel folders to clipboard

Post by notabot »

I am writing a little application that is basically my take on Listary's QuicKSwitch ( video for those unfamiliar with it)
For that, I need to read the current folders in the active as well as the inactive pane.

This will do that:
"C:\path to\XYplorer.exe" /feed="::copytext get('path', a)"
"C:\path to\XYplorer.exe" /feed="::copytext get('path', i)"

However, this has a disadvantage for my use-case as it activates the XYPlorer window and bringing it to the front.
This changes the Z-order of applications (basically the order that ALT+TAB follows), which is important in this case.


Question (finally :))

Can I get this information somehow *without* activating the XYPlorer window?


BTW: Excellent documentation! (and a pleasure to read, too). Took me less than 10 minutes to get from scratch to this point. Well done!

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Get active/inactive panel folders to clipboard

Post by highend »

Via WM_COPYDATA send / receive messages
One of my scripts helped you out? Please donate via Paypal

notabot
Posts: 59
Joined: 24 Feb 2021 12:34

Re: Get active/inactive panel folders to clipboard

Post by notabot »

Thank you!!

notabot
Posts: 59
Joined: 24 Feb 2021 12:34

Re: Get active/inactive panel folders to clipboard

Post by notabot »

For now, I used Send_XYPlorer_Message(_thisID, "::copytext get('path', a);") and
Send_XYPlorer_Message(_thisID, "::copytext get('path', i);") to get active/passive folder to the clipboard.
(based on this thread)

Is there another way - I bet there is - to get the active/passive pane folders but *doesn't* use the clipboard?


(Entire QuickSwitch code, including the part mentioned above can be found here, but I can post it here too if that is more convenient).

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Get active/inactive panel folders to clipboard

Post by highend »

Sure, use a Receive_WM_COPYDATA function and let XY send back the results via copydata...
One of my scripts helped you out? Please donate via Paypal

notabot
Posts: 59
Joined: 24 Feb 2021 12:34

Re: Get active/inactive panel folders to clipboard

Post by notabot »

Yes, I got that I need some sort of Receive_WM_COPYDATA function.
But what to send? Copydata <something> ?

A bit more detail would be helpful here ...

(AHK language, if that matters)

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Get active/inactive panel folders to clipboard

Post by highend »

Send the script (_to_ XYplorer together with your own hwnd, otherwise XY can't send the result back^^) that collects the data and which (at the same time) sends back the results, e.g.

Code: Select all

SendXYScript() {
    global dataReceived, G_OwnHWND

    xyQueryScript =
    ( LTrim Join
        ::$callerHWnd = %G_OwnHWND%;
            $aPanePath = get('path', 'a');
            copydata $callerHWnd, $aPanePath, 2;
    )

    Send_WM_COPYDATA(xyQueryScript)
    return dataReceived
}

and then eval the result of what was send back by XYplorer...
One of my scripts helped you out? Please donate via Paypal

notabot
Posts: 59
Joined: 24 Feb 2021 12:34

Re: Get active/inactive panel folders to clipboard

Post by notabot »

notabot wrote: 23 Mar 2021 11:26 But what to send? Copydata <something> ?
highend wrote: 23 Mar 2021 11:51

Code: Select all

            $aPanePath = get('path', 'a');
            copydata $callerHWnd, $aPanePath, 2;
How did I miss that? :shock:

Thank you, @highend!

Post Reply