XYplorer Messenger - Rev. 1.20 / 2013/02/08

Discuss and share scripts and script files...
admin
Site Admin
Posts: 60598
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: XYplorer Messenger - Rev. 1.10 / 2013/02/07

Post by admin »

I think I got it: You are passing a trailing NULL character with you WM_COPYDATA, which leads to several confusions depending on other factors. Simply don't do this and the thing should work.
BAD:

Code: Select all

::open "C:\path\new.cue"NULL
GOOD:

Code: Select all

::open "C:\path\new.cue"

Marco
Posts: 2347
Joined: 27 Jun 2011 15:20

Re: XYplorer Messenger - Rev. 1.10 / 2013/02/07

Post by Marco »

Solved! A non-sense "+ 1" in the variable that contains the command length, fixed.
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

admin
Site Admin
Posts: 60598
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: XYplorer Messenger - Rev. 1.20 / 2013/02/08

Post by admin »

Confirmed, it works now. And your EXE is less than half the size. :shock:

Marco
Posts: 2347
Joined: 27 Jun 2011 15:20

Re: XYplorer Messenger - Rev. 1.20 / 2013/02/08

Post by Marco »

admin wrote:Confirmed, it works now. And your EXE is less than half the size. :shock:
I set the highest compression + upx packing in the compiler. I'm trying to figure out if lower size can mean faster execution, but I guess the answer is no, right? If some good samaritan could write this in C or some "serious" language...
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

admin
Site Admin
Posts: 60598
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: XYplorer Messenger - Rev. 1.20 / 2013/02/08

Post by admin »

Smallness and Speed are usually a trade off. You cannot increase both.

serendipity
Posts: 3358
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: XYplorer Messenger - Rev. 1.20 / 2013/02/08

Post by serendipity »

Thanks again Marco! Works great!! :appl:

Just having this in the shortcut works great for any script:

Code: Select all

pathtoxyplorer_messenger.exe ::load "myscript.xys"
Tried several scripts, no problems. I was successful in using /script switch though, but no big deal the above syntax works already.

Enternal
Posts: 1174
Joined: 10 Jan 2012 18:26

Re: XYplorer Messenger - Rev. 1.20 / 2013/02/08

Post by Enternal »

admin wrote:Smallness and Speed are usually a trade off. You cannot increase both.
Yeah usually you cannot trade off. However in this case I think he definitely can which is why he's looking for C programmers. Unfortunately I'm not very good at it and have only been using C for embedded system. Never really tried for OS programming so I can't help either.

binocular222
Posts: 1416
Joined: 04 Nov 2008 05:35
Location: Hanoi, Vietnam

Re: XYplorer Messenger - Rev. 1.20 / 2013/02/08

Post by binocular222 »

xyplorer_messenger.exe leaves a small glitch everytime it runs. This hurts when I schedule to runs xyplorer_messenger.exe every 2 seconds by this Autohotkey code:

Code: Select all

#Persistent
Settimer, Rework, 2000
return
Rework:
run xyplorer_messenger.exe :: load Rename2.xys
return
P.S: If this glitch cannot be fixed, then I would suggest a much more simple method: running xyplorer.exe with /flg=2
such as this:

Code: Select all

run E:\7Utilities\XYplorer\XYplorer.exe /script=Rename2 /flg=2
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488

Marco
Posts: 2347
Joined: 27 Jun 2011 15:20

Re: XYplorer Messenger - Rev. 1.20 / 2013/02/08

Post by Marco »

What kind of glitch? You mean that it breafly appears in the tray? If so I'll if there's a switch to not show that icon.
The simpler method that you suggest has an important drawback, at least for my usage: it cause XY window to become visible and in foreground, with focus. I took this road exactly to avoid this behaviour.

EDIT: would this suit your needs, http://www.autoitscript.com/autoit3/doc ... ayIcon.htm ?
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

binocular222
Posts: 1416
Joined: 04 Nov 2008 05:35
Location: Hanoi, Vietnam

Re: XYplorer Messenger - Rev. 1.20 / 2013/02/08

Post by binocular222 »

I added #notrayicon and complied another .exe
The tray glitch no longer appear but the cusor briefly switch to the hour glass ?!
Maybe I need to keep the exe running in the brackground instead of calling it every 2 secs
I can use settimer with Autohotkey but don't know which command in Autoit.
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488

Marco
Posts: 2347
Joined: 27 Jun 2011 15:20

Re: XYplorer Messenger - Rev. 1.20 / 2013/02/08

Post by Marco »

Well, the hour glass icon is expected: every time you execute something there's an execution time.
I'm an AutoIt newbie, so I don't know what's the command to keep the execution resident in the tray. I see it is based on while loops, but seems a not efficient solution to me.
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

binocular222
Posts: 1416
Joined: 04 Nov 2008 05:35
Location: Hanoi, Vietnam

Re: XYplorer Messenger - Rev. 1.20 / 2013/02/08

Post by binocular222 »

Well, it's easy:
To load script "Rename2.xys" every 1 seconds:

Code: Select all

#NoTrayIcon
_Loop()

Func _Loop()
	While 1
$Script = "::load Rename2"
$WM_COPYDATA = 0x004A
$hWnd = WinGetHandle("[CLASS:ThunderRT6FormDC]")
$dwData = 0x00400001

$iSize = StringLen($Script)
$pMem = DllStructCreate("wchar[" & $iSize & "]")
DllStructSetData($pMem, 1, $Script)

$pCds = DllStructCreate("dword;dword;ptr")
DllStructSetData($pCds, 1, $dwData)
DllStructSetData($pCds, 2, ($iSize * 2))
DllStructSetData($pCds, 3, DllStructGetPtr($pMem))

DllCall("user32.dll", "lresult", "SendMessageW", "hwnd", $hWnd, "uint", $WM_COPYDATA, "wparam", 0, "lparam", DllStructGetPtr($pCds))

	Sleep(1000)
	WEnd
EndFunc
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488

binocular222
Posts: 1416
Joined: 04 Nov 2008 05:35
Location: Hanoi, Vietnam

Re: XYplorer Messenger - Rev. 1.20 / 2013/02/08

Post by binocular222 »

Well, I translated Macro's code to Autohotkey language:

Code: Select all

Script := ":: msg Hi"
WM_COPYDATA := 74 ; 0x4A
HWND := WinExist("ahk_class ThunderRT6FormDC")
DWData := 4194305
Size := StrLen(Script)
If !(A_IsUnicode) {
   VarSetCapacity(Data, Size * 2, 0)
   StrPut(Script, &Data, "UTF-16")
} Else {
   Data := Script
}
VarSetCapacity(COPYDATA, A_PtrSize * 3, 0)
NumPut(DWData, 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", WM_COPYDATA, "Ptr", 0, "Ptr", &COPYDATA, "Ptr")
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488

klownboy
Posts: 4141
Joined: 28 Feb 2012 19:27

Re: XYplorer Messenger - Rev. 1.20 / 2013/02/08

Post by klownboy »

I made some Windows shortcuts using xyplorer_messenger as serendipity did. I noticed that

Code: Select all

D:\Tools\XYplorer\Scripts\xyplorer_messenger.exe ::load "D:\Tools\XYplorer\Scripts\ThumbnailViewer_exec.xys"
as a shortcut works great, but only if XYplorer is already running. Is this what is expected or am I doing something incorrectly? Setting up a Windows shortcut with the following however, will start XYplorer if it's not already and run the script.

Code: Select all

D:\Tools\XYplorer\XYplorer.exe /script=D:\Tools\XYplorer\Scripts\ThumbnailViewer_exec.xys /flg=2
Also binocular222, I use AHK quite a bit for key assignments and many other things mostly outside of XYplorer, so I tried your AHK version with a first line of the following:

Code: Select all

Script := "::load 'D:\Tools\XYplorer\Scripts\ThumbnailViewer_exec.xys'"
(By the way, it didn't work until I single quoted the script name). I setup a Windows shortcut to run the AHK script, "D:\Tools\AutoHotkey\AHK scripts\script_name.ahk" and I received the same result as I mentioned above. The script seems to work only if XYplorer is already running.
Thanks,
Ken
Windows 11, 23H2 Build 22631.3447 at 100% 2560x1440

Marco
Posts: 2347
Joined: 27 Jun 2011 15:20

Re: XYplorer Messenger - Rev. 1.20 / 2013/02/08

Post by Marco »

klownboy wrote:I made some Windows shortcuts using xyplorer_messenger as serendipity did. I noticed that

Code: Select all

D:\Tools\XYplorer\Scripts\xyplorer_messenger.exe ::load "D:\Tools\XYplorer\Scripts\ThumbnailViewer_exec.xys"
as a shortcut works great, but only if XYplorer is already running. Is this what is expected or am I doing something incorrectly? Setting up a Windows shortcut with the following however, will start XYplorer if it's not already and run the script.

Code: Select all

D:\Tools\XYplorer\XYplorer.exe /script=D:\Tools\XYplorer\Scripts\ThumbnailViewer_exec.xys /flg=2
Also binocular222, I use AHK quite a bit for key assignments and many other things mostly outside of XYplorer, so I tried your AHK version with a first line of the following:

Code: Select all

Script := "::load 'D:\Tools\XYplorer\Scripts\ThumbnailViewer_exec.xys'"
(By the way, it didn't work until I single quoted the script name). I setup a Windows shortcut to run the AHK script, "D:\Tools\AutoHotkey\AHK scripts\script_name.ahk" and I received the same result as I mentioned above. The script seems to work only if XYplorer is already running.
Thanks,
Ken
Yes, it is expected to work only if XY is already running.
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

Post Reply