P
puzzle
Unregistered / Unconfirmed
GUEST, unregistred user!
我要得到当前程序占用内存的情况,<br>包含了 PSAPI了。<br>var<br> PMC: PPROCESS_MEMORY_COUNTERS;<br> hPID: HWND;<br> l: DWORD;<br> bRet: boolean;<br>begin<br> hPID:= GetCurrentProcessId();<br> new(PMC);<br> l:= SizeOf(PMC^);<br> ZeroMemory(PMC, l);<br> bRet:= GetProcessMemoryInfo(hPID, PMC, l); // bRet一直返回false,为什么<br> Caption:= IntToStr(PMC^.WorkingSetSize);<br> dispose(PMC);<br>end;<br>