函数参考


_WinAPI_EmptyWorkingSet

从指定进程移除所有可能页

#Include <WinAPIEx.au3>
_WinAPI_EmptyWorkingSet ( [$PID] )

参数

$PID [可选参数] 进程 PID. 默认 0, 为当前进程.

返回值

成功: 返回 1.
失败: 返回 0,设置@error标志为非 0 值.

注意/说明

None

相关

详情参考

在MSDN中搜索


示例/演示


#Include <WinAPIEx.au3>

Opt('MustDeclareVars', 1)

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

MsgBox(64 + 262144, '', 'Look at the memory used by the "' & _WinAPI_PathStripPath(FileGetLongName(@AutoItExe)) & '" (' & @AutoItPID & ') process.')

; 分配内存来创建数组
Dim $Data[1000000]
For $i = 0 To UBound($Data) - 1
    $Data[$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(64 + 262144, '', 'Step 1')

; 清空工作集
_WinAPI_EmptyWorkingSet()

MsgBox(64 + 262144, '', 'Step 2')

; 从数据中读取数据
For $i = 0 To UBound($Data) - 1
    If $Data[$i] Then
        ; 某些
    EndIf
Next

MsgBox(64 + 262144, '', 'Step 3')

; 清空工作集
_WinAPI_EmptyWorkingSet()

MsgBox(64 + 262144, '', 'Step 4')