UDF > WinAPIEx > Processes & Synchronization > Processes >


_WinAPI_EmptyWorkingSet

Supprime autant de pages que possible de l'espace de travail du processus sp�cifi�

#include <WinAPIProc.au3>
_WinAPI_EmptyWorkingSet ( [$iPID = 0] )

Param�tre

$iPID [optionnel] Le PID du processus. Par d�faut, (0) est le processus actuel.

Valeur de retour

Succ�s: Retourne 1.
�chec: Retourne 0 et d�finit @error <> 0.

Voir aussi

Consultez EmptyWorkingSet dans la librairie MSDN.

Exemple

#include <MsgBoxConstants.au3>
#include <WinAPIProc.au3>
#include <WinAPIShPath.au3>

Run(@SystemDir & '\taskmgr.exe')
Sleep(1000)

MsgBox(BitOR($MB_ICONINFORMATION, $MB_SYSTEMMODAL), '�tape 0', 'Montre la m�moire utilis�e par le processus "' & _WinAPI_PathStripPath(FileGetLongName(@AutoItExe)) & '" (' & @AutoItPID & ').')

; Alloue de la m�moire pour cr�er un tableau
Local $aData[1000000]
For $i = 0 To UBound($aData) - 1
    $aData[$i] = 'AutoIt v3 is a freeware BASIC-like scripting language designed for automating the Windows GUI and general scripting. It uses a combination of simulated keystrokes, mouse movement and window/control manipulation in order to automate tasks in a way not possible or reliable with other languages (e.g. VBScript and SendKeys). AutoIt is also very small, self-contained and will run on all versions of Windows out-of-the-box with no annoying "runtimes" required!'
Next

MsgBox(BitOR($MB_ICONINFORMATION, $MB_SYSTEMMODAL), '�tape 1', 'Alloue de la m�moire pour cr�er un tableau')

; Vide l'espace de travail
_WinAPI_EmptyWorkingSet()

MsgBox(BitOR($MB_ICONINFORMATION, $MB_SYSTEMMODAL), '�tape 2', 'Lib�re l''espace de travail')

; Lit les donn�es du tableau
For $i = 0 To UBound($aData) - 1
    If $aData[$i] Then
        ; quelque chose
    EndIf
Next

MsgBox(BitOR($MB_ICONINFORMATION, $MB_SYSTEMMODAL), '�tape 3', 'Lit les donn�es du tableau')

; Lib�re l'espace de travail
_WinAPI_EmptyWorkingSet()

MsgBox(BitOR($MB_ICONINFORMATION, $MB_SYSTEMMODAL), '�tape 4', 'Lib�re l''espace de travail')