Now that explains it better. Since you put it that way, I'd have to at least partially agree.jsmorley wrote: ↑March 23rd, 2019, 2:46 pmIt's just not trivial to do. NULL is used by the C language to indicate the end of a string, and we would have to deal with that. binary values are another issue, as what do we return, the raw binary number, the number converted to HEX / Decimal. All, in all, a fair amount of thought and care would need to be put into this.
It is currently March 28th, 2024, 4:38 pm
Measure Registry Multi-String?
- Yincognito
- Rainmeter Sage
- Posts: 7025
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Measure Registry Multi-String?
- Yincognito
- Rainmeter Sage
- Posts: 7025
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Measure Registry Multi-String?
I've already tested \0 substitutions on REG_MULTI_SZ values, and it does not work. Rainmeter gets the string only up until the NUL character, meaning that whatever substitution you try to do, it will only act on the first line of text from a REG_MULTI_SZ value.StArL0rd84 wrote: ↑March 23rd, 2019, 2:26 pm The measure only returns the first line, as if the substitute was not even there:
D:\Images\Vintage
'D:\Images\Futurism' is still missing...
Try using the CMD+reg query combo, like this (adapt it to your needs):
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
[MeasureRun]
Measure=Plugin
Plugin=RunCommand
Parameter=reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v "PagingFiles"
State=Hide
OutputType=ANSI
RegExpSubstitute=1
Substitute="\r?\n":"","(?si)^.*REG_MULTI_SZ\s+":""
[MeterRun]
Meter=String
FontSize=11
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=Click to Run
LeftMouseUpAction=[!CommandMeasure MeasureRun "Run"]
[MeterResult]
Meter=String
MeasureName=MeasureRun
Y=10R
FontSize=14
FontColor=255,255,255,255
AntiAlias=1
Last edited by Yincognito on March 23rd, 2019, 3:39 pm, edited 1 time in total.
- jsmorley
- Developer
- Posts: 22628
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Measure Registry Multi-String?
Your conclusion is right. The Registry measure is going to read up to the first NULL character, which means "end of string", and will be done with it. The answer is going to be RunCommand and either a cmd or Powershell command to get the desired information.
- Yincognito
- Rainmeter Sage
- Posts: 7025
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Measure Registry Multi-String?
And a PowerShell equivalent (as always, adapt it to your needs):
The difference (and the reason it didn't work before) is that -command is needed before the actual command, and, of course, the command interpreter (which is still CMD) needs the quotes (") to be escaped by using \ before them.
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
[MeasureRun]
Measure=Plugin
Plugin=RunCommand
Program=powershell
Parameter=-command Get-ItemProperty -Path \"HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\" | Select-Object -ExpandProperty \"PagingFiles\"
State=Hide
OutputType=ANSI
RegExpSubstitute=1
Substitute="\r?\n":""
[MeterRun]
Meter=String
FontSize=11
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=Click to Run
LeftMouseUpAction=[!CommandMeasure MeasureRun "Run"]
[MeterResult]
Meter=String
MeasureName=MeasureRun
Y=10R
FontSize=14
FontColor=255,255,255,255
AntiAlias=1
- balala
- Rainmeter Sage
- Posts: 16110
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Measure Registry Multi-String?
And what if you don't add a Substitute option?StArL0rd84 wrote: ↑March 23rd, 2019, 2:26 pm The measure only returns the first line, as if the substitute was not even there:
D:\Images\Vintage
'D:\Images\Futurism' is still missing...
- SilverAzide
- Rainmeter Sage
- Posts: 2588
- Joined: March 23rd, 2015, 5:26 pm
- Contact:
Re: Measure Registry Multi-String?
Yincognito's code is what you want. I only gave you the Powershell command line. Try this:StArL0rd84 wrote: ↑March 23rd, 2019, 7:41 am Tested Substitute="\0":"|" today and i'm afraid it does not work either.
Still only returns the first string.
I have never used Powershell together with Rainmeter before.
How do i format the measure?
The following measure only returns the number 103...
Code: Select all
[mMultiString]
Measure=Plugin
Plugin=RunCommand
Program=Powershell
Parameter=-Command "Get-ItemProperty -Path 'HKCU:\Software\Binary Fortress Software\DisplayFusion\Wallpaper\c01c88eb-b1af-446a-ba4c-d714a2c45fdd' | Select-Object -ExpandProperty Wallpaper_0_RotatePaths"
State=Hide
OutputType=ANSI
Last edited by SilverAzide on March 24th, 2019, 2:37 pm, edited 1 time in total.
- StArL0rd84
- Posts: 424
- Joined: February 8th, 2015, 10:07 pm
- Location: EU, Denmark.
- Yincognito
- Rainmeter Sage
- Posts: 7025
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Measure Registry Multi-String?
A little off-topic, but I discovered that the \0 badly needed to be escaped in my feeds skin as well, since when browsing these posts from Rainmeter's feed, it totally messed up the strings I was working with and the way things were displayed. I'm not yet sure if \0 was interpreted as the whole string or the end of the string, but once I escaped it, it all came back to normal.jsmorley wrote: ↑March 23rd, 2019, 3:41 pm Your conclusion is right. The Registry measure is going to read up to the first NULL character, which means "end of string", and will be done with it. The answer is going to be RunCommand and either a cmd or Powershell command to get the desired information.
- balala
- Rainmeter Sage
- Posts: 16110
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Measure Registry Multi-String?
I'm not too sure, but check Yincognito's above reply.
- Yincognito
- Rainmeter Sage
- Posts: 7025
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Measure Registry Multi-String?
Just as a clarification, as far as I know, I don't think setting UpdateDivider=-1 in that measure you posted will make any difference, since according to the manual, the plugin will take no action unless triggered with a [!CommandMeasure TheRunCommandMeasureName "Run"] bang. Instead, what you'd want is to set UpdateDivider=-1 on the measure where the bang that triggers the RunCommand measure is, not on the actual RunCommand measure.SilverAzide wrote: ↑March 23rd, 2019, 4:54 pmNote the UpdateDivider line, you probably don't need this running once a second, so it is best to do this one time and be done with it.
Of course, if the bang is executed within a mouse action, there will be no need for UpdateDivider=-1, since only that mouse action will trigger the running of the actual RunCommand measure.
A little convoluted system, I know - but from a logical point of view, it makes sense if you think about it.