#include #include #include #include global $g_MainGUI, $g_MemGUI, $g_MemDisplay Main() ; ------------------------------------ func Main() ; Main GUI $g_MainGUI = GUICreate('parent') GuiSetState(@SW_HIDE) HotKeySet("{F11}", ShowConfigGUI) ; Popup GUI $style = BitOR($WS_POPUP, $WS_BORDER) global $g_MemGUI = GUICreate("", 80, 40, (@DesktopWidth - 80 - 2), 0, $style) GUISetState(@SW_SHOW, $g_MemGUI) $g_MemDisplay = GUICtrlCreateLabel("", 10, 10, 60, 20) $timer = _Timer_SetTimer($g_MemGUI, 1000, "UpdateMemoryUsage") while True sleep(500) wend endfunc ; ------------------------------------ func UpdateMemoryUsage($hWnd, $iMsg, $iIDTimer, $iTime) $a = ProcessGetStats(-1, $PROCESS_STATS_MEMORY) $mem = ($a[0] / (1024 * 1024)) GUICtrlSetData($g_MemDisplay, StringFormat("%.1f Mb", $mem)) endfunc ; ------------------------------------ func ShowConfigGUI() $g_ConfigGUI = GUICreate("Configuration", 400, 300, -1, -1) GUICtrlCreateLabel("Hello", 10, 10) GUISetState(@SW_SHOW, $g_ConfigGUI) while True $msg = GuiGetMsg() select case ($msg = $GUI_EVENT_CLOSE) exitloop endselect wend GUIDelete($g_ConfigGUI) endfunc