hSnapshot = CreateToolhelp32Snapshot (2, 0)
.如果真 (hSnapshot ≠ -1)
LPPROCESSENTRY32.dwSize = 296
j = Process32First (hSnapshot, LPPROCESSENTRY32)
.判断循环首 (j ≠ 0)
.如果真 (到小写 (进程名) = 到小写 (到文本 (LPPROCESSENTRY32.szExeFile)))
' 调试输出 (到文本 (LPPROCESSENTRY32.szExeFile), 到小写 (进程名), LPPROCESSENTRY32.th32ProcessID)
' CloseHandle (hSnapshot)
hProcess = OpenProcess (2035711, 假, LPPROCESSENTRY32.th32ProcessID)
加入成员 (进程句柄, hProcess)
.如果真结束
j = Process32Next (hSnapshot, LPPROCESSENTRY32)
.判断循环尾 ()
CloseHandle (hSnapshot)
返回 (hProcess)