#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GUIConstants.au3>
#Region ### START Koda GUI section ### Form=
$hwnd = GUICreate("清理垃圾工具", 569, 383, 193, 125)
$Button1 = GUICtrlCreateButton("退 出", 464, 120, 89, 25, 0)
GUICtrlCreateLabel("内 存:", 180,206,100,25)
$mem=GUICtrlCreateLabel("", 240,206,50,100)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
info()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE,$Button1
Exit
EndSwitch
WEnd
Func info()
$objWMIService = objget("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
$colSettings = $objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
$colMemory = $objWMIService.ExecQuery("Select * from Win32_ComputerSystem")
For $object in $colMemory
GUICtrlSetData($mem,String(Int(Number($object.TotalPhysicalMemory) / (1024 * 1024))) & " MB")
Next
EndFunc
|