Page 2 of 3
Re: XYplorer Messenger (using AHK language)
Posted: 13 Jul 2014 01:31
by klownboy
Hi nerdweed, I don't have much time today, but to get you started or until binocular222 pipes in, I would recommend you first use AU3_Spy.exe to detect what the XY window is. I can tell you, since I checked already, that "ahk_class ThunderRT6FormDC" is the normal XYplorer window, and both the floating and full screen preview is: "ClassNN: ThunderRT6PictureBoxDC2". I'd strongly recommend looking and using the "MouseGetPos" example at the bottom of that page in the help file. It will give you a floating tooltip with valuable information of each window it's hovering over including, "ahk_class", "ahk_id", and "control". The "control" is the tricky part you need since that's what distinguishes the floating preview or full screen preview from the regular XYplorer window. Something like this determines if XYplorer is active, but it's been awhile so I'll have to research how to distinguish the control preview window "ThunderRT6PictureBoxDC2"
Code: Select all
HWND := WinExist("ahk_class ThunderRT6FormDC")
IfWinActive, ahk_id %HWND%
{ bla bla bla more code }
I'll dig some more tomorrow.
Ken
Re: XYplorer Messenger (using AHK language)
Posted: 13 Jul 2014 12:06
by nerdweed
Thanks. I have written this which works with a small catch due to checking on mouse position - I have to focus around center of the image due to some pics being of smaller size, but that should be OK, considering it is not mission critcal :p and I get to know about that immediately since I send a space key after rating the file to move the file which doesn't happen.
Is there any way to write the MouseGetPos on the first line itself.
Code: Select all
#If WinActive("ahk_class ThunderRT6FormDC", "" , "XYplorer", "" )
1:: Rate(1, "<curitem>")
2:: Rate(2, "<curitem>")
3:: Rate(3, "<curitem>")
4:: Rate(4, "<curitem>")
5:: Rate(5, "<curitem>")
0:: Rate("", "<curitem>")
Rate(Rating,File)
{
MouseGetPos, , , , Control
if (Control = "ThunderRT6PictureBoxDC2")
{
MessagetoXYplorer := "::tagitems(ex:Rating, '" . Rating . "', " . File . ") `;"
Communicate(MessagetoXYplorer)
Send {Space}
}
Else {
Send %Rating%
}
Return
}
Re: XYplorer Messenger (using AHK language)
Posted: 13 Jul 2014 14:24
by klownboy
Hey nerdweed, honestly I wasn't thinking of using MouseGetPos in the script but only to use it as a tool to get the window information needed. I was hoping to detect the control window via a different method like ControlGetFocus or ControlGet. This way you wouldn't have an issue with exact mouse placement. Though, I'm afraid it's a bit more difficult to determine when the ClassNN control like "ThunderRT6PictureBoxDC2 is "active"...still researching.
Ken
Re: XYplorer Messenger (using AHK language)
Posted: 13 Jul 2014 14:28
by highend
No time for this today (girlfriend is here), but this wouldn't be so hard.
A loop that checks all controls in the active window and if it matches
"like "ThunderRT6PictureBoxDC2" you already have the correct one.
Re: XYplorer Messenger (using AHK language)
Posted: 13 Jul 2014 14:37
by nerdweed
No hurry. I have something workable for now. Do give it a try when you have some free time and please let me know if you come up with something.
And, I found a better way to do this as mentioned by Highend
Code: Select all
WinGet, Control, ControlList , "ahk_class ThunderRT6FormDC", , "XYplorer"
if (Control Like "*ThunderRT6PictureBoxDC2*")
instead of this
Code: Select all
MouseGetPos, , , , Control
if (Control = "ThunderRT6PictureBoxDC2")
Now, is there any way to check this in the first if statement
#If WinActive("ahk_class ThunderRT6FormDC", "" , "XYplorer", "" )
Re: XYplorer Messenger (using AHK language)
Posted: 13 Jul 2014 14:54
by binocular222
Code: Select all
#If Checking()
1:: Rate(1, "<curitem>")
2:: Rate(2, "<curitem>")
3:: Rate(3, "<curitem>")
4:: Rate(4, "<curitem>")
5:: Rate(5, "<curitem>")
0:: Rate("", "<curitem>")
Checking()
{
MouseGetPos, , , , Control
If Control in _WwG1,ThunderRT6PictureBoxDC2,ThunderRT6PictureBoxDC60,Richedit20WPT6,Richedit20WPT7,Richedit20WPT8,Richedit20WPT12 AND WinActive("ahk_class ThunderRT6FormDC")
return 1
}
Rate(Rating,File)
{
MessagetoXYplorer := "::tagitems(ex:Rating, '" . Rating . "', " . File . ") `;"
Communicate(MessagetoXYplorer)
Sendinput {Space}
Return
}
Notice that possible values of ClassNN in a floating preview is numerous (i.e: _WwG1,ThunderRT6PictureBoxDC2,...), the above list is incomprehensive. To check on your own computer: Run this script and hover mouse over a floating preview
Code: Select all
#Persistent
settimer, checkcontrol, 200
checkcontrol:
MouseGetPos, , , , Control
tooltip %Control%
return
P.S: Seems like I return from vacation on time before this thread is flooded
Re: XYplorer Messenger (using AHK language)
Posted: 13 Jul 2014 15:13
by nerdweed
Sorry, but I didn't understand much of what you intended to say apart from this
1. I can't use something like the below
If ((WinGet, Control, ControlList , "ahk_class ThunderRT6FormDC", , "XYplorer") In ThunderRT6PictureBoxDC2)
2. Using Like is a bad option and hence used n
I always ThunderRT6PictureBoxDC2 for Floating Preview and Full Screen Preview (ThunderRT6PictureBoxDC1 for the filename info). I tried restarting XY as well and launched the preview later, but it still matches this.
P.S. Sorry to flood this thread. Didn't want to create another thread for AHK stuff and I wouldn't have had much luck on the AHK forum with this.
Re: XYplorer Messenger (using AHK language)
Posted: 13 Jul 2014 16:04
by binocular222
My script above should work as it. Have you tried it? Anything wrong?
The only line you should customize is
Code: Select all
If Control in _WwG1,ThunderRT6PictureBoxDC2,ThunderRT6PictureBoxDC60,Richedit20WPT6,Richedit20WPT7,Richedit20WPT8,Richedit20WPT12 AND WinActive("ahk_class ThunderRT6FormDC")
It already include ThunderRT6PictureBoxDC1. It's a special syntax, thus don't try to add round bracket to it. The syntax is
Code: Select all
If Variable in value1,value2,value3,value4
equal to
Code: Select all
if(Variable="value1" OR Variable="value2" OR Variable="value3" OR Variable="value4")
Re: XYplorer Messenger (using AHK language)
Posted: 13 Jul 2014 17:28
by nerdweed
It does work with ThunderRT6PictureBoxDC2 alone. I have marked this line in there as well - just in case someday it doesn't work out. I thought you meant it wouldn't work all the time since you said the list isn't all inclusive.
Thanks guys.
Re: XYplorer Messenger (using AHK language)
Posted: 09 Dec 2014 05:44
by binocular222
This bug should be fixed:
If regional and language setting is set to use dot as thousand separator and comma as decimal separator, then the following fucked up:
FunctionMessagetoXYplorer("::msg 01,2009") ;not work at all
FunctionMessagetoXYplorer("::msg 01.2009") ;XY return 01,2009
Anyone have a straightup fix? Or a neat work around?
Re: XYplorer Messenger (using AHK language)
Posted: 28 Jul 2015 21:31
by highend
Is there a way to use SendNotifyMessageW instead of SendMessageW?
The necessity to wait for XY to process the script (and therefore freezing my application that sends it) is... baaaaad. I need an asynchronous call :/ Using a command line call (/script="" + /flg=2) isn't really an option...
Both functions have the same syntax but just replacing it doesn't work...
https://msdn.microsoft.com/en-us/librar ... 85%29.aspx
https://msdn.microsoft.com/en-us/librar ... 85%29.aspx
Re: XYplorer Messenger (using AHK language)
Posted: 31 Jul 2015 20:45
by highend
No way to get an async wm_copydata call?
I'd have a nice app in the pipeline...
*shameless bump*
Re: XYplorer Messenger (using AHK language)
Posted: 09 Sep 2022 01:29
by LostFirefox36
This is probably far fetched as the original script was posted almost 10 years ago, but it recently stopped working after the 23.40 release according to the post here:
viewtopic.php?f=7&t=18062&p=202981#p202981
I'm not sure how to go about debugging why it's no longer working, if someone has any input i'd appreciate it. I use this function in a bunch of my daily scripts.
Re: XYplorer Messenger (using AHK language)
Posted: 09 Sep 2022 01:36
by jupe
Have you tried the latest XYplorer 23.60, the bug you posted about in RC script thread was fixed last month here:
viewtopic.php?p=202233#p202233
that thread has some AHK code you could compare too, else the bug you encountered is another one.
Re: XYplorer Messenger (using AHK language)
Posted: 09 Sep 2022 01:44
by LostFirefox36
Ah! Didn't realize there was an update. I installed 23.60 and it solved the issue. Thanks!!