Edit: Sorry, I hadn't noticed jupe responded already.
XYplorer Messenger (using AHK language)
-
klownboy
- Posts: 4397
- Joined: 28 Feb 2012 19:27
- Location: Windows 11, 25H2 Build 26200.7171 at 100% 2560x1440
Re: XYplorer Messenger (using AHK language)
Yes, it should be fine now. See this thread for some background. viewtopic.php?f=2&t=25041 and notes for beta v23.50.0203 - 2022-08-25 12:36.
Edit: Sorry, I hadn't noticed jupe responded already.
Edit: Sorry, I hadn't noticed jupe responded already.
Re: XYplorer Messenger (using AHK language)
Hey,
Have you got this to work on AHKv2
Have you got this to work on AHKv2
-
klownboy
- Posts: 4397
- Joined: 28 Feb 2012 19:27
- Location: Windows 11, 25H2 Build 26200.7171 at 100% 2560x1440
Re: XYplorer Messenger (using AHK language)
No, I haven't tried AHK version 2 beta. I've stuck with 1.1.XX Ansi 32-bit version for ages...no particular reason though. Maybe one of the other XY forum members have used AHK beta version 2.
EDIT: I did end up downloading and trying version 2, but I encountered a slew of errors in my AHK startup script which includes the messenger along with a bunch of other things.
EDIT: I did end up downloading and trying version 2, but I encountered a slew of errors in my AHK startup script which includes the messenger along with a bunch of other things.
Re: XYplorer Messenger (using AHK language)
Yes, there are few changes which can be checked here. I've compled the MessageToXY as below. I never used MessageFromXYplorer, so need to check on it.
Code: Select all
MsgToXY(msg) {
HWND := WinExist("XYplorer ahk_class ThunderRT6FormDC")
If !(HWND)
Return 1
Size := StrLen(msg)
buf := Buffer(3*A_PtrSize + Size*A_PtrSize) ; Size of Pointer + Size of Length + Size of Message
NumPut "Ptr", 4194305, buf
NumPut "UInt", Size*2, buf, A_PtrSize
NumPut "Ptr", StrPtr(msg), buf, A_PtrSize*2
SendMessage 0x004a, 0, buf, , "ahk_id " HWND
Return 0
}
Re: XYplorer Messenger (using AHK language)
Full Script for AHK2
Code: Select all
SenderHWND := A_ScriptHwnd + 0
OnMessage(0x004a, MsgFromXY)
MsgToXY("::copydata " . SenderHWND . ", <curitem>")
MsgToXY(msg) {
HWND := WinExist("XYplorer ahk_class ThunderRT6FormDC")
If !(HWND)
Return 1
Size := StrLen(msg)
buf := Buffer(3*A_PtrSize + Size*A_PtrSize) ; Size of Pointer + Size of Length + Size of Message
NumPut "Ptr", 4194305, buf
NumPut "UInt", Size*2, buf, A_PtrSize
NumPut "Ptr", StrPtr(msg), buf, A_PtrSize*2
SendMessage 0x004a, 0, buf, , "ahk_id " HWND
Return 0
}
MsgFromXY(wParam, lParam, msg, hwnd) {
StringAddress := NumGet(lParam, 2*A_PtrSize, "Ptr")
CopyOfData := StrGet(StringAddress)
cbData := NumGet(lParam, A_PtrSize, "UInt")/2
DataReceived := SubStr(CopyOfData, 1, cbData)
MsgBox(DataReceived)
Return DataReceived
}
-
klownboy
- Posts: 4397
- Joined: 28 Feb 2012 19:27
- Location: Windows 11, 25H2 Build 26200.7171 at 100% 2560x1440
Re: XYplorer Messenger (using AHK language)
Thanks nerdweed for updating the XYplorer messenger AHK script and posting it. I wonder if that script version will work in AHK version 1.1 (i.e., backward compatible)? I may try it when I get a chance.
Re: XYplorer Messenger (using AHK language)
Reading the version 2 description and changes from v1
I don't think there are any default combatibilty backward.
That will be one of the big problems getting v2 to replace the v1 line.
I don't think there are any default combatibilty backward.
That will be one of the big problems getting v2 to replace the v1 line.
Windows 11 Home, Version 25H2 (OS Build 26200.7171)
Portable x64 XYplorer (Actual version, including betas)
Display settings 1920 x 1080 Scale 100%
Everything 1.5.0.1400a (x64), Everything Toolbar 2.1.0, Listary Pro 6.3.6.99
Portable x64 XYplorer (Actual version, including betas)
Display settings 1920 x 1080 Scale 100%
Everything 1.5.0.1400a (x64), Everything Toolbar 2.1.0, Listary Pro 6.3.6.99
Re: XYplorer Messenger (using AHK language)
It won't work on AHK1.1
Re: XYplorer Messenger (using AHK language)
Full Script for AHK1 - Tried to match it as best I could to the v2 version.
Code: Select all
#SingleInstance, force
SetTitleMatchMode, 2
DetectHiddenWindows, On
SenderHWND := A_ScriptHwnd + 0 ;Return this script's hidden hwdn id. +0 to convert from Hex to Dec
OnMessage(0x4a, "MsgFromXY")
MessagetoXYplorer := "::CopyData " SenderHWND ", ""<curitem>"", 2"
; MessagetoXYplorer := "::msg Hello"
MsgToXY(MessagetoXYplorer)
MsgToXY(msg) {
HWND := WinExist("XYplorer ahk_class ThunderRT6FormDC")
If !(HWND) {
MsgBox % "XYplorer not found"
Return 1
}
Size := StrLen(msg)
VarSetCapacity(buf, 3*A_PtrSize + Size*A_PtrSize, 0) ; Size of Pointer + Size of Length + Size of Message
NumPut(4194305, buf, 0, "Ptr")
NumPut(Size*2, buf, A_PtrSize, "UInt")
NumPut(&msg, buf, A_PtrSize * 2, "Ptr")
SendMessage 0x4a, 0, &buf, , ahk_id %HWND%
Return 0
}
MsgFromXY(wParam, lParam, msg, hwnd) {
StringAddress := NumGet(lParam + 2*A_PtrSize, "Ptr")
CopyOfData := StrGet(StringAddress)
cbData := NumGet(lParam + A_PtrSize, "UInt")/2
DataReceived := SubStr(CopyOfData, 1, cbData)
MsgBox % DataReceived
Return DataReceived
}
XYplorer Beta Club