Code : Tout sélectionner
#cs ----------------------------------------------------------------------------
AutoIt Version : 3.3.3.0
Auteur: Tlem
Fonction du Script :
Modèle de Script AutoIt.
#ce ----------------------------------------------------------------------------
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Global $ProcID
$Proc = InputBox("My Watching Process", "Entrez le nom du processus à surveiller :")
$ProcID = ProcessExists($Proc)
If $ProcID = 0 Then
MsgBox(32, "Erreur", "Le processus " & $Proc & " n'existe pas !!!")
Exit
EndIf
#Region ### START Koda GUI section ### Form=
$GUI = GUICreate("My Watching Process", 313, 257, -1, -1)
$Lbl_0_1 = GUICtrlCreateLabel("Process Name :", 24, 16, 150, 20)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
$Lbl_0_2 = GUICtrlCreateLabel("", 150, 16, 200, 20)
GUISetFont(8, 800, 0, "MS Sans Serif")
$Lbl_1_1 = GUICtrlCreateLabel("I/O Read :", 72, 56, 80, 17)
$Lbl_2_1 = GUICtrlCreateLabel("I/O Write :", 72, 88, 80, 17)
$Lbl_3_1 = GUICtrlCreateLabel("I/O Other :", 72, 120, 80, 17)
$Lbl_4_1 = GUICtrlCreateLabel("Bytes Read :", 72, 152, 80, 17)
$Lbl_5_1 = GUICtrlCreateLabel("Bytes Write :", 72, 184, 80, 17)
$Lbl_6_1 = GUICtrlCreateLabel("Bytes Other :", 72, 216, 80, 17)
GUISetFont(8, 400, 0, "MS Sans Serif")
$Lbl_1_2 = GUICtrlCreateLabel("", 168, 56, 100, 17)
$Lbl_2_2 = GUICtrlCreateLabel("", 168, 88, 100, 17)
$Lbl_3_2 = GUICtrlCreateLabel("", 168, 120, 100, 17)
$Lbl_4_2 = GUICtrlCreateLabel("", 168, 152, 100, 17)
$Lbl_5_2 = GUICtrlCreateLabel("", 168, 184, 100, 17)
$Lbl_6_2 = GUICtrlCreateLabel("", 168, 216, 100, 17)
GUICtrlSetData($Lbl_0_2, $Proc)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case Else
$aInfos = ProcessGetStats($Proc, 1)
GUICtrlSetData($Lbl_1_2, $aInfos[0])
GUICtrlSetData($Lbl_2_2, $aInfos[1])
GUICtrlSetData($Lbl_3_2, $aInfos[2])
GUICtrlSetData($Lbl_4_2, $aInfos[3])
GUICtrlSetData($Lbl_5_2, $aInfos[4])
GUICtrlSetData($Lbl_6_2, $aInfos[5])
Sleep(30)
EndSwitch
WEnd