内存函数:GUICtrlCreateLabel("使用内存:", 10, 155, 75, 20)
$label11 = GUICtrlCreateLabel("100%", 245, 155, 30)
GUICtrlCreateGraphic(85, 150, 150, 15)
GUICtrlSetColor(-1, 0x000000)
$progress11 = GUICtrlCreateGraphic(86, 155, 0, 13)
GUICtrlSetColor($progress11, 0x000000)
GUICtrlSetBkColor($progress11, 0x0FB1FF)
GUICtrlCreateLabel("空闲内存:", 10, 210, 75, 20)
$label12 = GUICtrlCreateLabel("100%", 245, 210, 30)
GUICtrlCreateGraphic(85, 210, 150, 15)
GUICtrlSetColor(-1, 0x000000)
$progress12 = GUICtrlCreateGraphic(86, 210, 0, 13)
GUICtrlSetColor($progress12, 0x000000)
GUICtrlSetBkColor($progress12, 0x0FB1FF)
_API_SetLayeredWindowAttributes($Form1 , 0xABCDEF)
Func memcontrol()
$i = 100
While 1
$i = $i + 10
If $i > 100 And $fUpdateMeminfo Then
$memstats = MemGetStats()
$RamF = Round(100 * ($memstats[1] - $memstats[2]) / $memstats[1], 1)
GUICtrlSetPos($progress11, 86, 150, $RamF * 1.49, 13)
GUICtrlSetData($label11, $RamF & "%")
$RamF = Round(100 * ($memstats[2] / $memstats[1]), 1)
If $RamF < 1 Then
GUICtrlSetPos($progress12, 86, 210, 1, 13)
Else
GUICtrlSetPos($progress12, 86, 210, $RamF * 1.49, 13)
EndIf
GUICtrlSetData($label12, $RamF & "%")
$RamF = $memstats[1] - $memstats[2]
$i = 0
ExitLoop
EndIf
WEnd
EndFunc
|