Lets all help me make some Dxmetres!
Friday, August 4, 2006 by Jaramia | Discussion: DesktopX
Reply #3 Sunday, August 6, 2006 2:47 PM
Reply #4 Sunday, August 6, 2006 7:24 PM
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
Please login to comment and/or vote for this skin.
Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:
- Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
- Access to a great community, with a massive database of many, many areas of interest.
- Access to contests & subscription offers like exclusive emails.
- It's simple, and FREE!







Reply #1 Friday, August 4, 2006 12:14 PM