Gandolf wrote:Horizontal:
Code: Select all
some AHK code, that opens two instances of XY tiled
horizontally.
Vertical:
Code: Select all
some AHK code, that opens two instances of XY tiled vertically.
Two suggestions:
1) Though your solution is ultimately quicker, I'd like to draw your attention to
http://jgpaiva.donationcoders.com/gridmove.html if you have not already seen it. You can create layouts and then move windows to a defined area quickly via hotkey or drag and drop. It's a tool I've grown to love and it makes sure I'm using all of my monitor space. (It's also written in AHK.)
2) I'd suggest a couple slight modifications to your script.
Code: Select all
Duplicate_XY(mode = 0) {
;Path to XYplorer.
XY_EXE_PATH := "C:\Program Files\XYplorer\XYplorer.exe"
;Parameters to pass to XY. ("/win=normal" ensures the window does not start minimized/in the tray)
XY_EXE_ARGS := "/win=normal"
;WinTitle that will identify XY's main window.
XY_ID := "XYplorer ahk_class ThunderRT6FormDC ahk_pid "
;Store the current title match mode so it can be restored.
stmm := A_TitleMatchMode
SetTitleMatchMode 2
;Run the first instance (store the process id in pidA)
Run, %XY_EXE_PATH% %XY_EXE_ARGS%,,,pidA
idA := XY_ID . pidA
WinWaitActive, %idA%
;Run the second instance (store the process id in pidB)
Run, %XY_EXE_PATH% %XY_EXE_ARGS%,,,pidB
idB := XY_ID . pidB
WinWaitActive, %idB%
;Get the primary monitor's work area.
SysGet, MonitorWorkArea, MonitorWorkArea, 1
if (mode) {
;Arrange the windows vertically.
WinMove, %idA%,, 0, 0, (MonitorWorkAreaRight/2), (MonitorWorkAreaBottom)
WinMove, %idB%,, (MonitorWorkAreaRight/2), 0, (MonitorWorkAreaRight/2), (MonitorWorkAreaBottom)
} else {
;Arrange the windows horizontally.
WinMove, %idA%,, 0, 0, (MonitorWorkAreaRight), (MonitorWorkAreaBottom/2)
WinMove, %idB%,, 0, (MonitorWorkAreaBottom/2), (MonitorWorkAreaRight), (MonitorWorkAreaBottom/2)
}
;Activate the top/left one.
WinActivate, %idA%
;Restore title match mode.
SetTitleMatchMode, %stmm%
return
}
That's as a single function that can do either tiling mode.
For horizontal set your hotkey to call Duplicate_XY() or Duplicate_XY(0)
and for vertical use Duplicate_XY(1).
The only real difference to your code is I use the process IDs returned from the run command to identify the windows (instead of changing the title) and I added the "/win=normal" command line switch when starting XY.
-----
As for the actual topic of DP, I'd love to see some implementation of this in XY, but I don't really miss it.
What I think would be interesting is to set a tab to a folder compare mode, which displays the contents of two paths so it's easier to compare them. (Switching tabs is easy, but comparing them side by side is so much better.)