Jump to content
Sign in to follow this  
Laymanball

MemoWrite System Info

Recommended Posts

Laymanball

Short report. For system info. With memowrite function.

Main_OSI()
Func Main_OSI()
Global $sMessage, $mtText
$mtText='OperateSystemInfo'
$nCPU=RegRead('HKLM\HARDWARE\DESCRIPTION\System\CentralProcessor\0', 'ProcessorNameString')
$nOS=RegRead('HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion', 'ProductName')
$ServicePack=RegRead('HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion', 'CSDVersion')
$tHarddisk=DriveSpaceTotal('C:') ;OperateVar
$fHarddisk=DriveSpaceFree('C:')
$tMemory=MemGetStats()
$fMemory=MemGetStats()
MemoWrite('CPU: '&$nCPU&@CR& _
          'OS: '&$nOS&' '&$ServicePack&@CRLF& _
    'HDD(C): '&Round($tHarddisk/1024)& _
    ' G FREE: '&Round($fHarddisk/1024)& _  ;MemoWrite Table.
    ' G'&@CRLF& _
    'MEM: '&Round($tMemory[1]/1024)& _
    ' MB FREE: '&Round($fMemory[2]/1024)& _
    ' MB')
EndFunc ;==>OperateSystemInfo.
Func MemoWrite($sMessage="")
MsgBox(64, $mtText, $sMessage) ;MemoWrite Message.
EndFunc ;==>Memomessage.

Graphic User Interfade.

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$mtText='OperateSystemInfo'
$nCPU=RegRead('HKLM\HARDWARE\DESCRIPTION\System\CentralProcessor\0', 'ProcessorNameString')
$nOS=RegRead('HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion', 'ProductName')
$ServicePack=RegRead('HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion', 'CSDVersion')
$tHarddisk=DriveSpaceTotal('C:') ;OperateVar
$fHarddisk=DriveSpaceFree('C:')
$tMemory=MemGetStats()
$fMemory=MemGetStats()
$Form1 = GUICreate($mtText, 307, 122, -1, -1, BitOR($WS_SYSMENU,$WS_CAPTION,$WS_POPUP,$WS_POPUPWINDOW,$WS_BORDER,$WS_CLIPSIBLINGS))
GUISetIcon("C:\WINDOWS\system32\winfxdocobj.exe")
$Button1 = GUICtrlCreateButton("OK", 104, 85, 88, 25, $WS_GROUP)
GUICtrlSetFont(-1, 10, 400, 0, "Tahoma")
$Icon1 = GUICtrlCreateIcon("C:\WINDOWS\system32\ahui.exe", -1, 12, 12, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
$Label1 = GUICtrlCreateLabel("CPU: "&$nCPU, 64, 10, 300, 17)
$Label2 = GUICtrlCreateLabel("OS: "&$nOS&' '&$ServicePack, 64, 26, 300, 17)
$Label3 = GUICtrlCreateLabel("HDD(C): "&Round($tHarddisk/1024)&' G FREE: '&Round($fHarddisk/1024)&" G", 64, 42, 300, 17)
$Label4 = GUICtrlCreateLabel("MEM: "&Round($tMemory[1]/1024)&' MB FREE: '&Round($fMemory[2]/1024)&' MB', 64, 58, 300, 17)
GUISetState(@SW_SHOW)
Do
$msg=GUIGetMsg()
Switch $msg
Case -3
Exit
Case $Button1
ExitLoop
EndSwitch
Until False

OR ADD MemGetStats

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <ProgressConstants.au3>
$mtText='OperateSystemInfo'
$nCPU=RegRead('HKLM\HARDWARE\DESCRIPTION\System\CentralProcessor\0', 'ProcessorNameString')
$nOS=RegRead('HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion', 'ProductName')
$ServicePack=RegRead('HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion', 'CSDVersion')
$tHarddisk=DriveSpaceTotal('C:') ;OperateVar
$fHarddisk=DriveSpaceFree('C:')
$tMemory=MemGetStats()
$Form1 = GUICreate($mtText, 307, 135, -1, -1, BitOR($WS_SYSMENU,$WS_CAPTION,$WS_POPUP,$WS_POPUPWINDOW,$WS_BORDER,$WS_CLIPSIBLINGS), BitOR($WS_EX_TOPMOST,$WS_EX_WINDOWEDGE))
GUISetIcon("C:\WINDOWS\system32\winfxdocobj.exe")
$Button1 = GUICtrlCreateButton("OK", 104, 100, 88, 25, $WS_GROUP)
GUICtrlSetFont(-1, 10, 400, 0, "Tahoma")
$Icon1 = GUICtrlCreateIcon("C:\WINDOWS\system32\ahui.exe", -1, 12, 12, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
$Label1 = GUICtrlCreateLabel("CPU: "&$nCPU, 64, 10, 300, 17)
$Label2 = GUICtrlCreateLabel("OS: "&$nOS&' '&$ServicePack, 64, 26, 300, 17)
$Label3 = GUICtrlCreateLabel("HDD(C): "&Round($tHarddisk/1024)&' G FREE: '&Round($fHarddisk/1024)&" G", 64, 42, 300, 17)
$Label4 = GUICtrlCreateLabel("RAM: "&Round($tMemory[1]/1024)&' MB', 64, 58, 300, 17)
$Label5 = GUICtrlCreateLabel("FREE: "&Round($tMemory[2]/1024)&' MB', 141, 58, 75, 17)
$Label6 = GUICtrlCreateLabel($tMemory[0]&'%', 200, 74, 30, 17)
$Label7 = GUICtrlCreateLabel('LOAD:', 65, 74, 75, 17)
$Progress1 = GUICtrlCreateProgress(100, 76, 95, 12)
GUICtrlSetData(-1, $tMemory[0])
GUISetState(@SW_SHOW)
$begin = TimerInit()
AdlibRegister("_Timer", 250)
Do
$msg=GUIGetMsg()
Switch $msg
Case -3
Exit
Case $Button1
ExitLoop
EndSwitch
Until False
Func _Timer()
$fMemory=MemGetStats()
$rMemory = Round($fMemory[2]/1024)
$lMemory = $fMemory[0]
If TimerDiff($begin)>1000 Then
ControlSetText($mtText, "", $Label5, StringFormat('FREE: '&$rMemory&' MB', '%d'))
ControlSetText($mtText, "", $Label6, StringFormat($lMemory&'%', '%d'))
GUICtrlSetData($Progress1, $lMemory)
$begin = TimerInit()
EndIf
EndFunc

Last post. I stoped post this forum. Move go to other forum.

Edited by Laymanball
  • Like 1

My Sample Script

Download: VistaDesktopIconsChangerForXp.au3 (Com,Doc and Bin only) http://www.4shared.com/rar/NMHYL5Igba/VistaDesktopIconsChangerForXp_.html

                     VistaDesktopIconsChangerForXp.exe (Resources) http://www.4shared.com/rar/nzs7Mb1gba/VistaDesktopIconsChangerForXp_.html

Share this post


Link to post
Share on other sites
ahmeddzcom

Nice Script ... TNX

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×