Please refer to this post here viewtopic.php?p=202026#p202026 The simple AHK script which set the perm variable and send it to XYplorer is in the first post of that thread, but for ease of viewing I repeat it here. Thanks.
Code: Select all
IfWinActive, ahk_class ThunderRT6FormDC
{
#If (DetectContextMenu() = 1)
{
RButton::
MessagetoXYplorer = ::perm $rmb=1;
SendFunction(MessagetoXYplorer)
click
Return
}
#IfWinActive
}
DetectContextMenu() ; based on closeContextMenu() by Stefaan - http://www.autohotkey.com/community/viewtopic.php?p=163183#p163183
;https://autohotkey.com/board/topic/85769-how-to-detect-existence-of-a-right-click-menu in-any-app/
{
GuiThreadInfoSize = 48
VarSetCapacity(GuiThreadInfo, 48)
NumPut(GuiThreadInfoSize, GuiThreadInfo, 0)
if not DllCall("GetGUIThreadInfo", uint, 0, str, GuiThreadInfo)
{
MsgBox GetGUIThreadInfo() indicated a failure.
Return
}
; GuiThreadInfo contains a DWORD flags at byte 4
; Bit 4 of this flag is set if the thread is in menu mode. GUI_INMENUMODE = 0x4
If (NumGet(GuiThreadInfo, 4) & 0x4)
Return 1 ; we've found a context menu
Else
Return 0
}
SendFunction(MessagetoXYplorer)
{
HWND := WinExist("ahk_class ThunderRT6FormDC")
Size := StrLen(MessagetoXYplorer)
If !(A_IsUnicode) {
VarSetCapacity(Data, Size * 2, 0)
StrPut(MessagetoXYplorer, &Data, "UTF-16")
} Else {
Data := MessagetoXYplorer
}
VarSetCapacity(COPYDATA, A_PtrSize * 3, 0)
NumPut(4194305, COPYDATA, 0, "Ptr")
NumPut(Size * 2, COPYDATA, A_PtrSize, "UInt")
NumPut(&Data, COPYDATA, A_PtrSize * 2, "Ptr")
Result := DllCall("User32.dll\SendMessageW", "Ptr", HWND, "UInt", 74, "Ptr", 0, "Ptr", ©DATA, "Ptr")
}
XYplorer Beta Club