Lets all help me make some Dxmetres!

Well i would like to make some simple Dxmetres (Memory, C drive and RAM) I know how to make the basic Performance metres but i dont know how to make the Percentage on the side...and does anyone have anyother additional features i could add to this? (i am using this for my personal use)
1,988 views 4 replies
Reply #1 Top
You want some text to go along side the meter to display the percentage value? I'm pretty sure there's examples of that in the gallery. Have a look at them and see how they are made.
Reply #3 Top
I actually made a little object displaying the amount of Free RAM and a percentage next to it using WMI - drawback is currently you have to manually code the amout of RAM there is for it to work out the percentage... I will post the code for it when I get home from work for ya
Reply #4 Top
Okidokes! Ready for the Code?!

Dim WMI, CI, x2

Sub Object_OnScriptEnter
Set WMI = GetObject("winmgmts:\\.\root\cimv2")
x2 = DesktopX.Object("TotalRAM").Text 'This is a seperate object using DesktopX System Information plugin to get the amount of System Memory, you can replace x2 with the actual amount of RAM (i.e. 512, 256, etc etc)
Object.SetTimer 1, 1000
Object_OnTimer1
End Sub

Sub Object_OnTimer1
Set CI = WMI.ExecQuery("Select * From Win32_PerfFormattedData_PerfOS_Memory",,48)
For Each OI In CI
x = OI.AvailableMBytes/x2 * 100 ' This sorts the percentage bit out
Object.Text = "Free RAM: " & OI.AvailableMBytes & "MB" & " (" & Round(x,0) & "%)" 'The Round function just rounds the percentage to 0 Decimal places, to give a whole percentage
Next
End Sub

Sub Object_OnScriptExit
Set WMI = Nothing
Object.KillTimer 1
End Sub

And there we have it a Free RAM display with Percentage