| View previous topic :: View next topic |
| Author |
Message |
aaffe
Joined: 17 May 2007 Posts: 66
|
Posted: Mon Feb 25, 2008 2:15 pm Post subject: How to get the main memory? |
|
|
Hallo,
does anybody know how to get the dimension of the main memory?
Tanks!
Greets, aaffe |
|
| Back to top |
|
 |
wOxxOm
Joined: 09 Feb 2006 Posts: 319
|
|
| Back to top |
|
 |
aaffe
Joined: 17 May 2007 Posts: 66
|
Posted: Tue Feb 26, 2008 1:39 pm Post subject: |
|
|
Hy,
thanks for your tip, but I already found this script.
Itīs a pity but I wasnīt able to write out the section which gets and shows the main memory....
Could you help me, please?
Tanks! |
|
| Back to top |
|
 |
wOxxOm
Joined: 09 Feb 2006 Posts: 319
|
Posted: Tue Feb 26, 2008 2:24 pm Post subject: |
|
|
| Code: | .............
RamUpdate: ;Laszlos memory usage code
DllCall("kernel32.dll\GlobalMemoryStatus", "uint",&memorystatus)
mem:=*(&memorystatus+4) ; LS byte is enough, mem = 0..100
mem := (mem/100) * ram_bar_w
guicontrol 14:move,bar14, % "w" mem
return |
and | Code: | if ram_bar_show
{
VarSetCapacity(memorystatus, 4+4+4+4+4+4+4+4)
success := DllCall("kernel32.dll\GlobalMemoryStatus", "uint", &memorystatus)
total := Round(ReadInteger(&memorystatus,8,4, false)/1024/1024)
used := total - Round(ReadInteger(&memorystatus,12,4, false)/1024/1024)
output := output "Memory: " round(mem) "% " used "/" total "mb"
} |
of course you will have to intelligently rip these parts out of that script (or maybe find another example searching for "GlobalMemoryStatus" this time) |
|
| Back to top |
|
 |
UsernSC
Joined: 24 May 2008 Posts: 11
|
Posted: Sat May 24, 2008 2:58 pm Post subject: |
|
|
| How about when you have > 2 Gb & < 4 Gb Ram? I've tried using GlobalMemoryStatusEx with no luck ... yet |
|
| Back to top |
|
 |
jaco0646
Joined: 07 Oct 2006 Posts: 557 Location: MN, USA
|
Posted: Sat May 24, 2008 3:25 pm Post subject: |
|
|
| Code: | RunWait, %comspec% /c systeminfo > tmpFile,,Hide
FileRead, info, tmpFile
FileDelete, tmpFile
Loop, Parse, info, `n,`r
If (InStr(A_LoopField,"Total") = 1)
MsgBox,64,Total Physical Memory:,% SubStr(A_LoopField,28) |
The systeminfo command has lots of interesting info. _________________ http://autohotkey.net/~jaco0646/ |
|
| Back to top |
|
 |
UsernSC
Joined: 24 May 2008 Posts: 11
|
Posted: Sun May 25, 2008 2:44 pm Post subject: |
|
|
| thanks for they reply. I only want to retrieve ONE item. The info you gave does just that, after getting 100 items and searching for specific info(time consuming). Its just not I was looking for, thanks anyway. |
|
| Back to top |
|
 |
|