1. There is any possibility to get the value of a variable into the AutoIt script? I can read the ini or inc file (using the IniRead function), but I'd need a way to get even a new value of the variable, set with the !SetVariable option. Can it be done?
2. First I thought it'll be possible to use the au3 script in the same way as a lua script. Obviously it's not possible, because as the Help sais, a Script measure
So, there is any possibility to use a such au3 script, or it must be compiled and use the exe?measures information returned using the Lua scripting language
3. One more question, if only the exe can be used: I wrote the following very simple AutoIt script:
Code: Select all
#include <WinAPIFiles.au3>
#include <SendMessage.au3>
#include <MsgBoxConstants.au3>
SendBang('!SetVariable Var "' & ReadTheFile() & '"')
Exit (0)
Func SendBang($szBang)
local Const $hWnd = WinGetHandle("[CLASS: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
Func ReadTheFile()
Local Const $sFilePath = "Variables.inc"
Local $hFileOpen = FileOpen($sFilePath, $FO_READ)
If $hFileOpen = -1 Then
MsgBox($MB_SYSTEMMODAL, "", "An error occurred when reading the file.")
Return False
EndIf
Local $sFileRead = IniRead($sFilePath, "Variables", "MyVar", "")
FileClose($hFileOpen)
Return ($sFileRead)
EndFunc
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
OnUpdateAction=["#@#ReadMyVar.exe"]
[MeterResult]
Meter=String
X=0
Y=0
Padding=15,5,15,5
FontSize=14
FontColor=255,255,255
SolidColor=0,0,0,120
AntiAlias=1
Text=#Var#
DynamicVariables=1
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
OnUpdateAction=[!CommandMeasure MeasureRun "Run"]
[MeasureRun]
Measure=Plugin
Plugin=RunCommand
Program=#@#ReadMyVar.exe
State=Hide
[MeterResult]
Meter=String
X=0
Y=0
Padding=15,5,15,5
FontSize=14
FontColor=255,255,255
SolidColor=0,0,0,120
AntiAlias=1
Text=#Var#
DynamicVariables=1
So could be used the ReadMyVar.exe in way to avoid this continuous pointer changing?
I attached the skin.
Thanks in advance.