It is currently April 23rd, 2024, 8:21 pm
Sending Bangs to Rainmeter with AutoIt
-
- Developer
- Posts: 2872
- Joined: April 17th, 2009, 12:18 pm
Re: Sending Bangs to Rainmeter with AutoIt
Which of those parameters/variables contained the square brackets?
-
- Posts: 366
- Joined: November 12th, 2009, 4:47 pm
- Location: Ukraine
Re: Sending Bangs to Rainmeter with AutoIt
ShellExecute($CmdVar5, "!RainmeterSetOption " & $CmdVar2 & " " & $CmdVar3 & ' "' & $curName & '"' & ' "' & $CmdVar6 & '"')poiru wrote:Which of those parameters/variables contained the square brackets?
$curName means name of track, so it can be so:
Every Little Thing - キヲク [iTunes Originals Version]
Just try it for yourself using command line (or link)
result=crash/freeze"C:\Program Files\Rainmeter\Rainmeter.exe" !RainmeterSetOption NameOfSelection NameOfOption "Every Little Thing - キヲク [iTunes Originals Version]" "Config"
and then for testing
result=option changed"C:\Program Files\Rainmeter\Rainmeter.exe" !RainmeterSetOption NameOfSelection NameOfOption "Every Little Thing - キヲク ~iTunes Originals Version~" "Config"
-
- Developer
- Posts: 2872
- Joined: April 17th, 2009, 12:18 pm
Re: Sending Bangs to Rainmeter with AutoIt
Thanks, I'll fix this for the next beta~Faradey~ wrote:...
-
- Posts: 366
- Joined: November 12th, 2009, 4:47 pm
- Location: Ukraine
Re: Sending Bangs to Rainmeter with AutoIt
Looks like this approach can't be used with other than latin characters, as i noticed, too bad(
but maybe it's possible to make a encoding/decoding somewhere, i still don't get it, where it's converts...or may by this is in AutoIt script?
This part of string "Фарадей" converts to "Ôàðàäåé"
and, Rainmeter can't find the imageAny ideas?
but maybe it's possible to make a encoding/decoding somewhere, i still don't get it, where it's converts...or may by this is in AutoIt script?
This part of string "Фарадей" converts to "Ôàðàäåé"
and, Rainmeter can't find the image
Code: Select all
Image: Unable to open: C:\Users\Ôàðàäåé\Documents\Rainmeter\Skins...
Tested! Confirmed!Fixed an infinite loop / hang when Rainmeter.exe is called with a bang containing square brackets (e.g. Rainmeter.exe !Bang "[Text]")
-
- Posts: 397
- Joined: June 22nd, 2010, 4:11 am
Re: Sending Bangs to Rainmeter with AutoIt
Well, first...
Unicode includes few precomposed accented Cyrillic letters, the others can be combined by adding U+0301 ("combining acute accent") after the accented vowel.
But that's just a bit of added information for future reference.
Now, real problem...
For troubleshooting purposes to test your script try dumping your output to a file instead of handing it off to rainmeter. If you're script successfully dumps the output to file then the problem is not with the script grabbing the data.
This is a troubleshooting dump function that I created and use.
If it does in fact dump successfully, then there is either a problem with the sendmessage command or with rainmeter. Make sure the sendmessage is done in UTF-16 Little Endian. If it is then the problem is most likely with rainmeter itself.
Unicode includes few precomposed accented Cyrillic letters, the others can be combined by adding U+0301 ("combining acute accent") after the accented vowel.
But that's just a bit of added information for future reference.
Now, real problem...
For troubleshooting purposes to test your script try dumping your output to a file instead of handing it off to rainmeter. If you're script successfully dumps the output to file then the problem is not with the script grabbing the data.
This is a troubleshooting dump function that I created and use.
Code: Select all
;~ _TroubleshootingDump( _
;~ Info to dump - Default = Line number of the currently executed script line, _
;~ Dump Filename - Default = "Troubleshooting.txt", _
;~ Directory to create file - Default = Working Directory, _
;~ File Open Mode - Default = 42 (http://www.autoitscript.com/autoit3/docs/functions/FileOpen.htm), _
;~ Add date and time to the dump, Default = True _
;~ )
Func _TroubleshootingDump($aDumpText = @ScriptLineNumber, $aDumpFilename = "TextDump.txt", $WorkingDirectory = @WorkingDir, $DumpOptions = "42", $aAddTimeDate = True)
Local $aDumpFileHandle
$aDumpFileHandle = FileOpen($aDumpFilename, $DumpFormat)
If $aAddTimeDate Then
Local $aTimeDateInfo = "| " & @Hour & ":" & @MIN & ":" & @SEC & " - " & @MON & "/" & @MDAY & "/" & @YEAR & " |"
FileWrite($aDumpFileHandle, "Start & $aTimeDateInfo & @LF & @LF)
EndIf
FileWrite($aDumpFileHandle, $aDumpText)
If $aAddTimeDate Then FileWrite($aDumpFileHandle, "End " & $aTimeDateInfo & @LF & @LF & "---------------------------------------------------" & @LF & @LF & @LF)
FileClose($aDumpFileHandle)
EndFunc
Last edited by santa_ryan on December 29th, 2011, 4:38 pm, edited 4 times in total.
I have three rules when I'm trying to help you.
- Don't get mad when you don't understand something
- Be VERY specific with what you ask for.
The more specific you are, the higher the quality of support you receive. - Do not just copy and paste what I put in examples and come back saying it doesn't work.
It does work, but I purposely left blanks that you need to fill for your specific needs.
-
- Developer
- Posts: 2872
- Joined: April 17th, 2009, 12:18 pm
Re: Sending Bangs to Rainmeter with AutoIt
You need to use SendMessageW (AFAIK, _SendMessage uses SendMessageW internally) and make sure the data is UTF-16LE. I have barely used AutoIT, so I don't know how to do this in it. Googling might yield an answer.~Faradey~ wrote:Looks like this approach can't be used with other than latin characters, as i noticed, too bad(
but maybe it's possible to make a encoding/decoding somewhere, i still don't get it, where it's converts...or may by this is in AutoIt script?
This part of string "Фарадей" converts to "Ôàðàäåé"
and, Rainmeter can't find the imageAny ideas?Code: Select all
Image: Unable to open: C:\Users\Ôàðàäåé\Documents\Rainmeter\Skins...
EDIT: Check next post.
-
- Developer
- Posts: 2872
- Joined: April 17th, 2009, 12:18 pm
Fix for Unicode support
~Faradey~ wrote:Looks like this approach can't be used with other than latin characters, as i noticed, too bad(
but maybe it's possible to make a encoding/decoding somewhere, i still don't get it, where it's converts...or may by this is in AutoIt script?
Here is a fixed version of SendBang that properly supports Unicode:santa_ryan wrote:If it does in fact dump successfully, then there is either a problem with the sendmessage command or with rainmeter. Make sure the sendmessage is done in UTF-16 Little Endian. If it is then the problem is most likely with rainmeter itself.
Code: Select all
#NoTrayIcon
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_UseUpx=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <SendMessage.au3>
Opt("WinTitleMatchMode", 4)
; Example:
SendBang("!About")
Func SendBang($szBang)
Local Const $hWnd = WinGetHandle("classname=RainmeterMeterWindow")
If $hWnd <> 0 Then
Local Const $iSize = StringLen($szBang) + 1
Local Const $pMem = DllStructCreate("wchar[" & $iSize & "]")
DllStructSetData($pMem, 1, $szBang)
Local Const $pCds = DllStructCreate("dword;dword;ptr")
DllStructSetData($pCds, 1, 1)
DllStructSetData($pCds, 2, ($iSize * 2))
DllStructSetData($pCds, 3, DllStructGetPtr($pMem))
Local Const $WM_COPYDATA = 0x004A
_SendMessage($hWnd, $WM_COPYDATA, 0, DllStructGetPtr($pCds))
EndIf
EndFunc
-
- Posts: 366
- Joined: November 12th, 2009, 4:47 pm
- Location: Ukraine
Re: Fix for Unicode support
It WORKS!!!poiru wrote: Here is a fixed version of SendBang that properly supports Unicode:Code: Select all
#NoTrayIcon #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseUpx=n #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <SendMessage.au3> Opt("WinTitleMatchMode", 4) ; Example: SendBang("!About") Func SendBang($szBang) Local Const $hWnd = WinGetHandle("classname=RainmeterMeterWindow") If $hWnd <> 0 Then Local Const $iSize = StringLen($szBang) + 1 Local Const $pMem = DllStructCreate("wchar[" & $iSize & "]") DllStructSetData($pMem, 1, $szBang) Local Const $pCds = DllStructCreate("dword;dword;ptr") DllStructSetData($pCds, 1, 1) DllStructSetData($pCds, 2, ($iSize * 2)) DllStructSetData($pCds, 3, DllStructGetPtr($pMem)) Local Const $WM_COPYDATA = 0x004A _SendMessage($hWnd, $WM_COPYDATA, 0, DllStructGetPtr($pCds)) EndIf EndFunc
Yahoo)))
Thank you!!!
partially i solved this issue myself a bit erlier but it was ugly way and not tested completely, so i didn't post it and now i'm definitely can say that i will use this approach, thanx
And one more thing, your help, from all of you guys, made it possible to release Kotoko Suite today)
-
- Posts: 366
- Joined: November 12th, 2009, 4:47 pm
- Location: Ukraine
Re: Sending Bangs to Rainmeter with AutoIt
Hi Guys)
Is there any Rainmeter WindowMessage or DllCall to get to know if skin is active (loaded) or not? I remember, it was a list of all Rainmeter WindowsMessages in manual, but now it's gone, or i can't just find it
I don't think that rainmeter reads Rainmeter.ini file every time it needs to check skin's state.
Or would it be hard to implant OnExitAction thing in rainmeter?
Pls) Tnx in advance
Is there any Rainmeter WindowMessage or DllCall to get to know if skin is active (loaded) or not? I remember, it was a list of all Rainmeter WindowsMessages in manual, but now it's gone, or i can't just find it
I don't think that rainmeter reads Rainmeter.ini file every time it needs to check skin's state.
Or would it be hard to implant OnExitAction thing in rainmeter?
Pls) Tnx in advance
-
- Developer
- Posts: 2872
- Joined: April 17th, 2009, 12:18 pm
Re: Sending Bangs to Rainmeter with AutoIt
They are indeed gone temporarily. I just now added what you want here (note: I haven't tested the GetSkinWindow AutoIT function).~Faradey~ wrote:Is there any Rainmeter WindowMessage or DllCall to get to know if skin is active (loaded) or not? I remember, it was a list of all Rainmeter WindowsMessages in manual, but now it's gone, or i can't just find it