Hallo,
ich bin neu hier, hab aber mir immer schonmal Hilfe in diesem Forum erlesen können. Nun hab ich ein Problemchen, bei dem ich nicht wirklich weiterkomme und auch Google nix verwertbares mehr ausspuckt.
Und zwar habe ich ein Script ein klein wenig versucht abzuändern.
Es handelt sich dabei um eine Simple GUI, die alle laufenden Prozesse anzeigt.
Nun dachte ich mir, das man anhand einer Liste die Systemprozesse von Win ausblenden könnte.
Das hat soweit auch ganz gut geklappt.
Ich kann doppelte Einträge (z.B. svchost.exe) aus dem Array löschen und andere Prozesse werden auch ausgefiltert. Allerdings besteht das Problem, das bei den doppelten oder auch mehrfach vorhandenen Prozessen, mir weiterhin ein Prozess angezeigt wird.
Ich hänge mal mein Script an, evtl. kann mir einer weiter helfen.
Spoiler anzeigen
#Include <GUIConstants.au3> ;Includes the information that allows you to create windows and controls
#Include <ArrayMore.au3>
Dim $string [ 1 ]
Dim $newProcesses[1]
$Window = GUICreate ( "Process Inspector" , 528 , 258 + 25 ) ;The main window
$List = GUICtrlCreateList ( "" , 2 , 2 , 524 , 262 ) ;Creates a large white box which lists strings in it
$ButtonRefresh = GUICtrlCreateButton ( "Refresh" , 30 , 260 , 462 , 20 )
GUISetState ( ) ;Enables your window so its visible
While 1
$msg = GUIGetMsg ( )
If $msg = $GUI_EVENT_CLOSE Then Exit
If $msg = $ButtonRefresh Then
GUICtrlDelete ( $List ) ;Recreates the list to
$List = GUICtrlCreateList ( "" , 2 , 2 , 524 , 262 ) ;quickly clear the data
Global $Processes = ProcessList ( )
;##################################
;Hier wird meine Funktion aufgerufen
$newProcesses = _DeleteSysProcesses($Processes)
;##################################
For $iCC = 1 To UBound ( $newProcesses ) - 1
$sLoadList = 'Process: ' & $newProcesses [ $iCC ] [ 0 ]
GUICtrlSetData ( $List , $sLoadList )
Next
EndIf
WEnd
Func _DeleteSysProcesses(ByRef $newArray)
_Array2DDblDel($newArray)
; Hier nun die Liste, könnte man später auch aus einer INI auslesen
DIM $Error [ 7 ]
$Error[0] = 'svchost.exe'
$Error[1] = 'smss.exe'
$Error[2] = 'dllhost.exe'
$Error[3] = 'dwm.exe'
$Error[4] = 'spoolsv.exe'
$Error[5] = 'csrss.exe'
$Error[6] = 'winlogon.exe'
For $i = 0 To UBound($Error) -1
$iIndex = _ArraySearch($newArray, $Error[$i], 0, 0, 0, 1, 0)
If $iIndex Then
_Array2DDelete($newArray, $iIndex)
Endif
Next
Return $newArray
EndFunc
[/autoit]