H
hikehilter
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TFrmMain.TimerTimer(Sender: TObject);
var
FHandle:Integer;
FSnapshotHandle: THandle;
FProcessEntry32: TProcessEntry32;
hProcess:hwnd;
ContinueLoop:Boolean;
SysInfo:SYSTEM_INFO ;
SysTemInfo:MEMORY_BASIC_INFORMATION;
MemoryTotal:Cardinal;
TmpbaseAddointer;
LpMem:^Integer;
begin
//Check if have Ie programming
//check if othere windows handle ,if have ,will close this windows handle
FSnapshotHandle:=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);
FProcessEntry32.dwSize := Sizeof(FProcessEntry32);
ContinueLoop := Process32First(FSnapshotHandle, FProcessEntry32);
while integer(ContinueLoop) <> 0 do
begin
hProcess:=OpenProcess(PROCESS_ALL_ACCESS,TRUE,FProcessEntry32.th32ProcessID);
GetSystemInfo(SysInfo);
lpMem := SysInfo.lpMinimumApplicationAddress;
While (VirtualQueryEx(hProcess,lpMem,SysTemInfo,SizeOf(SysTemInfo)) =SizeOf(SysTemInfo))do
begin
if SysTemInfo.State =MEM_COMMIT then
MemoryTotal:=MemoryTotal+SysTemInfo.RegionSize;
end;
ContinueLoop := Process32Next(FSnapshotHandle,
FProcessEntry32);
end;
CloseHandle(FSnapshotHandle);
close;
中间的怎么写。求招。
var
FHandle:Integer;
FSnapshotHandle: THandle;
FProcessEntry32: TProcessEntry32;
hProcess:hwnd;
ContinueLoop:Boolean;
SysInfo:SYSTEM_INFO ;
SysTemInfo:MEMORY_BASIC_INFORMATION;
MemoryTotal:Cardinal;
TmpbaseAddointer;
LpMem:^Integer;
begin
//Check if have Ie programming
//check if othere windows handle ,if have ,will close this windows handle
FSnapshotHandle:=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);
FProcessEntry32.dwSize := Sizeof(FProcessEntry32);
ContinueLoop := Process32First(FSnapshotHandle, FProcessEntry32);
while integer(ContinueLoop) <> 0 do
begin
hProcess:=OpenProcess(PROCESS_ALL_ACCESS,TRUE,FProcessEntry32.th32ProcessID);
GetSystemInfo(SysInfo);
lpMem := SysInfo.lpMinimumApplicationAddress;
While (VirtualQueryEx(hProcess,lpMem,SysTemInfo,SizeOf(SysTemInfo)) =SizeOf(SysTemInfo))do
begin
if SysTemInfo.State =MEM_COMMIT then
MemoryTotal:=MemoryTotal+SysTemInfo.RegionSize;
end;
ContinueLoop := Process32Next(FSnapshotHandle,
FProcessEntry32);
end;
CloseHandle(FSnapshotHandle);
close;
中间的怎么写。求招。