Hallo zusammen,
wer hilft mir Neuling :-), diesen Anfang meines Skriptes, welcher auf unseren Notebooks zur Kennwortsynchronisation dauerhaft ab Rechnerstart laufen soll, weiter zu verschlanken bzw. die Arbeitsspeicherlast zu reduzieren?
[autoit]While 1
$List = ''
$wl = WinList("[class:tooltips_class32]");get all th etooltips
For $n = 1 To $wl[0][0]
If BitAND(WinGetState($wl[$n][1]), 2) Then;if visible
$List &= WinGetTitle($wl[$n][1]); read the title, which for a tooltip is the text
EndIf
_ReduceMemory()
Next
If $List = "Sperren Sie den Computer und heben Sie anschließend die Sperrung unter Verwendung Ihres aktuellen Kennworts oder Ihrer Smartcard auf. Klicken Sie auf das Symbol, um weitere Informationen zu erhalten." Then
ExitLoop
EndIf
sleep(1000)
_ReduceMemory()
WEnd
Funktion:
[autoit]Func _ReduceMemory($i_PID = -1)
Local $ai_Return
If $i_PID <> -1 Then
Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $i_PID)
$ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0])
DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $ai_Handle[0])
Else
$ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', -1)
EndIf
Return $ai_Return[0]
EndFunc ;==>_ReduceMemory
(aus autoit.de)