BAD:
Code: Select all
::open "C:\path\new.cue"NULL
Code: Select all
::open "C:\path\new.cue"
Code: Select all
::open "C:\path\new.cue"NULL
Code: Select all
::open "C:\path\new.cue"
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...admin wrote:Confirmed, it works now. And your EXE is less than half the size.
Code: Select all
pathtoxyplorer_messenger.exe ::load "myscript.xys"
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.admin wrote:Smallness and Speed are usually a trade off. You cannot increase both.
Code: Select all
#Persistent
Settimer, Rework, 2000
return
Rework:
run xyplorer_messenger.exe :: load Rename2.xys
return
Code: Select all
run E:\7Utilities\XYplorer\XYplorer.exe /script=Rename2 /flg=2
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
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", ©DATA, "Ptr")
Code: Select all
D:\Tools\XYplorer\Scripts\xyplorer_messenger.exe ::load "D:\Tools\XYplorer\Scripts\ThumbnailViewer_exec.xys"
Code: Select all
D:\Tools\XYplorer\XYplorer.exe /script=D:\Tools\XYplorer\Scripts\ThumbnailViewer_exec.xys /flg=2
Code: Select all
Script := "::load 'D:\Tools\XYplorer\Scripts\ThumbnailViewer_exec.xys'"
Yes, it is expected to work only if XY is already running.klownboy wrote:I made some Windows shortcuts using xyplorer_messenger as serendipity did. I noticed thatas 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\Scripts\xyplorer_messenger.exe ::load "D:\Tools\XYplorer\Scripts\ThumbnailViewer_exec.xys"
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
D:\Tools\XYplorer\XYplorer.exe /script=D:\Tools\XYplorer\Scripts\ThumbnailViewer_exec.xys /flg=2
(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.Code: Select all
Script := "::load 'D:\Tools\XYplorer\Scripts\ThumbnailViewer_exec.xys'"
Thanks,
Ken