Run Seleted Or Full XYplorer script with call WM_COPYDATA

Discuss and share scripts and script files...
Post Reply
edyyus
Posts: 48
Joined: 16 May 2014 11:14

Run Seleted Or Full XYplorer script with call WM_COPYDATA

Post by edyyus »

My English not so good to write more

Continuation from discussions with highend in Wishes page
http://www.xyplorer.com/xyfc/viewtopic. ... 49#p145049

just to share autoit3 script to loading xys script
credit to highend

Image

Sample User Button 1: For Test Seleted Or Whole Script Button
i using sendkey Ctrl+c (copy to clipbord), I using Editpluss, i think compatible with most text editor allow run argument
select , if want run just seleted script or noting select if want run whole script.(current in editor)

Command : E:\Your\Path\AutoIt3.exe
Argument : RunXyplorerSelectedScript.exe

Code: Select all

Local Const $hwnd = WinGetHandle("[CLASS:ThunderRT6FormDC]")
Local Const $hwnd_1 = WinGetHandle("[ACTIVE]")
if WinExists($hwnd)=0 Then
  MsgBox(0, "Nortifications :", "XYplorer Windows Not Exit")
  Exit
Endif
WinActivate($hwnd_1)
$ClipBord=ClipGet()
ClipPut("")
Sleep(100)
Send("^c")
$ClipBord2=ClipGet()
$iLength = StringLen($ClipBord2)
If $iLength<5 Then
  Send("^a")
  Sleep(100)
  Send("^c")
  Sleep(100)
  $ClipBord2=ClipGet()
EndIf

$script = "::"&$ClipBord2
ClipPut($ClipBord)
$wm_copydata = 74
WinSetTrans($hWnd, "",0)
WinActivate($hwnd)
WinSetState ($hwnd, "",@SW_HIDE)
$dwdata = 4194305
$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))
WinSetState ($hwnd, "",@SW_MINIMIZE)
WinSetTrans($hWnd, "",255)

Exit


Compile Versions
Sample User Button 1: For Test Seleted Or Whole Script Button
If Using Compile exe
Command : E:\Your\Path\RunXyplorerSelectedScript.exe
Argument :

Some Editor Like Edit Plus, If noting seleted and and Send("^c"), can be copy active line(cussor located)
if want run whole script, locate(click) mouse in free line(without any word or letter bellow 5)
$iLength<5

Update Using WinSetState
V2
RunXyplorerSelectedScript.7z
V2
(395.58 KiB) Downloaded 164 times
V1
RunXyplorerSelectedScript.7z
V1
(394.85 KiB) Downloaded 155 times


Sample User Button 2, Run xys Script Button, like show Menu like FolderMenu3 EX
Command : E:\Your\Path\AutoIt3.exe
Argument : E:\Your\Path\RunXyplorerScript2.au3

change path for $sFilePath to your script

Code: Select all

#include <FileConstants.au3>
#include <MsgBoxConstants.au3>

Local Const $sFilePath = "E:\Change\Your\XYS\Script\Path.xys"
If $hFileOpen = -1 Then
  MsgBox($MB_SYSTEMMODAL, "", "An error occurred when reading the file.")
  Exit
EndIf

$script = "::load " & """" & $sFilePath & """"
FileClose($hFileOpen)
$wm_copydata = 74
$hwnd = WinGetHandle("[CLASS:ThunderRT6FormDC]")
WinSetState ($hwnd, "",@SW_MINIMIZE)
$dwdata = 4194305
$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))
Exit
Fell free to using, edit and make better

Hope other forumer or highend can make be better like using seting.ini or call executable autoit script with allow argument

Sample 2, like run "E:\Your\Autoit\RunXyplorerScriptCompile.exe E:\Your\XYS\Script\Path.xys"

Update RunXyplorerScript http://www.xyplorer.com/xyfc/viewtopic. ... 86#p145060
Last edited by edyyus on 18 Jan 2017 01:58, edited 3 times in total.

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Run Seleted Or Full XYplorer script with call WM_COPYDATA

Post by highend »

Hope other forumer or highend can make be better like using seting.ini or call executable autoit script with allow argument
That's not so difficult:

Code: Select all

If $CmdLine[0] = 0 Then
	MsgBox(0, "Error", "No script file passed as an argument, aborted...")
	Exit
EndIf

$script = "::load " & """" & $CmdLine[1] & """"
$hwnd = WinGetHandle("[CLASS:ThunderRT6FormDC]")
$isize = StringLen($script)
$pmem = DllStructCreate("wchar[" & $isize & "]")
DllStructSetData($pmem, 1, $script)
$pcds = DllStructCreate("dword;dword;ptr")
DllStructSetData($pcds, 1, 4194305)
DllStructSetData($pcds, 2, ($isize * 2))
DllStructSetData($pcds, 3, DllStructGetPtr($pmem))
DllCall("user32.dll", "lresult", "SendMessageW", "hwnd", $hwnd, "uint", 74, "wparam", 0, "lparam", DllStructGetPtr($pcds))

One of my scripts helped you out? Please donate via Paypal

edyyus
Posts: 48
Joined: 16 May 2014 11:14

Re: Run Seleted Or Full XYplorer script with call WM_COPYDATA

Post by edyyus »

Code: Select all

Local Const $hwnd = WinGetHandle("[CLASS:ThunderRT6FormDC]")
;Local Const $hwnd_1 = WinGetHandle("[ACTIVE]")
if WinExists($hwnd)=0 Then
  MsgBox(0, "Nortifications :", "XYplorer Windows Not Exit")
  Exit
Endif

If $CmdLine[0] = 0 Then
   MsgBox(0, "Error", "No script file passed as an argument, aborted...")
   Exit
EndIf

WinSetTrans($hWnd, "",0)
WinActivate($hwnd)
WinSetState ($hwnd, "",@SW_HIDE)
$script = "::load '"&$CmdLine[1]&"'"
$isize = StringLen($script)
$pmem = DllStructCreate("wchar[" & $isize & "]")
DllStructSetData($pmem, 1, $script)
$pcds = DllStructCreate("dword;dword;ptr")
DllStructSetData($pcds, 1, 4194305)
DllStructSetData($pcds, 2, ($isize * 2))
DllStructSetData($pcds, 3, DllStructGetPtr($pmem))
DllCall("user32.dll", "lresult", "SendMessageW", "hwnd", $hwnd, "uint", 74, "wparam", 0, "lparam", DllStructGetPtr($pcds))
WinSetState ($hwnd, "",@SW_MINIMIZE)
;WinActivate($hwnd_1)
WinSetTrans($hWnd, "",255)
Exit

Compile Versions + .au3, Using WinSetTrans and WinSetState @SW_HIDE
Command : E:\Your\Path\RunXyplorerScript.exe
Argument : "E:\Your\Path\Xplorer Script.xys" (if have space in path must quote "path")

To loading sub Argument : using quote and single quote at the coma ,
Argument : "E:\Your\Path\Xplorer Script.xys','_subtoloding"

Update 27 Feb 2017 Using WinSetTrans and WinSetState @SW_HIDE
V3
RunXyplorerScript&Sub.7z
RunXyplorerScript&Sub
(358.84 KiB) Downloaded 158 times

Old Versions
Command : E:\Your\Path\RunXyplorerScript.exe
Argument : E:\Your\Path\XplorerScript.xys (xys script path without space)
V2
RunXyplorerScript.7z
RunXyplorerScriptv2.7z
(395.67 KiB) Downloaded 141 times
V1
RunXyplorerScript.7z
RunXyplorerScript.7z
(394.24 KiB) Downloaded 148 times
Thanks highend, it work
just add WinSetState to minimized Main Xyplorer Windows to Taskbar
Last edited by edyyus on 27 Feb 2017 09:34, edited 1 time in total.

edyyus
Posts: 48
Joined: 16 May 2014 11:14

Re: Run Seleted Or Full XYplorer script with call WM_COPYDATA

Post by edyyus »

I learn make sofware with autoit, and to want share with other forumer
just simple executable in my first try

Learning Tools.exe,
http://www.xyplorer.com/xyfc/viewtopic. ... 22#p145422

I Post in Other Software page

edyyus
Posts: 48
Joined: 16 May 2014 11:14

Re: Run Seleted Or Full XYplorer script with call WM_COPYDATA

Post by edyyus »

Info :
RunXyplorerScriptProblem.png
RunXyplorerScriptProblem.png (18.04 KiB) Viewed 2502 times
Get some problem if forget close active windows like text, input msg or echo windows
and main Xyplorer windows in Hide Mode, script still running from RunXyplorerScript.exe
and run again script from RunXyplorerScript.exe when main Xyplorer windows in Hide Mode

If get problem Xyplorer windows Hide,
see bellow at windows button, if get some windows minimize like picture, close this windows
If Xyplorer windows still Hide, try see Xyplorer prosses in Task Manager, close And Run Again Xyplorer
:(

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Run Seleted Or Full XYplorer script with call WM_COPYDATA

Post by highend »

Sorry, read it twice and still don't understand what's the problem. Maybe a native english speaker has less problems
to find out what the exact problem is?
One of my scripts helped you out? Please donate via Paypal

edyyus
Posts: 48
Joined: 16 May 2014 11:14

Re: Run Seleted Or Full XYplorer script with call WM_COPYDATA

Post by edyyus »

highend wrote:Sorry, read it twice and still don't understand what's the problem. Maybe a native english speaker has less problems
to find out what the exact problem is?
Dificult to me to write more in english, sorry for thad
RunXyplorerScript.exe Using autoit command WinSetTrans and WinSetState @SW_HIDE to make sure just popup like menu, input or text windows popup ontop and still active to using., without show main xyplorer window(hide mode),

I using windows 7 and not try in other OS versions

*Just nortification and note, if get/fell some problem when using RunXyplorerScript.exe to run xyplorer script from external
like editplus editor, try see windows like picture and if get windows like picture,
Close this windows to end the script and show back Main Xyplorer Window in hide mode

:(

Post Reply