AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to get the main memory?

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
aaffe



Joined: 17 May 2007
Posts: 66

PostPosted: Mon Feb 25, 2008 2:15 pm    Post subject: How to get the main memory? Reply with quote

Hallo,
does anybody know how to get the dimension of the main memory?

Tanks!

Greets, aaffe
Back to top
View user's profile Send private message
wOxxOm



Joined: 09 Feb 2006
Posts: 319

PostPosted: Tue Feb 26, 2008 5:53 am    Post subject: Reply with quote

search the forum
one of the results: SysInfo in Task bar v3.0
Back to top
View user's profile Send private message Send e-mail Visit poster's website
aaffe



Joined: 17 May 2007
Posts: 66

PostPosted: Tue Feb 26, 2008 1:39 pm    Post subject: Reply with quote

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
View user's profile Send private message
wOxxOm



Joined: 09 Feb 2006
Posts: 319

PostPosted: Tue Feb 26, 2008 2:24 pm    Post subject: Reply with quote

Smile
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
View user's profile Send private message Send e-mail Visit poster's website
UsernSC



Joined: 24 May 2008
Posts: 11

PostPosted: Sat May 24, 2008 2:58 pm    Post subject: Reply with quote

How about when you have > 2 Gb & < 4 Gb Ram? I've tried using GlobalMemoryStatusEx with no luck ... yet
Back to top
View user's profile Send private message
jaco0646



Joined: 07 Oct 2006
Posts: 557
Location: MN, USA

PostPosted: Sat May 24, 2008 3:25 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
UsernSC



Joined: 24 May 2008
Posts: 11

PostPosted: Sun May 25, 2008 2:44 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group