Declare Function GetProcessWorkingSetSize Lib "kernel32.dll" ( _
ByVal hProcess As Long, _
ByRef lpMinimumWorkingSetSize As Long, _
ByRef lpMaximumWorkingSetSize As Long) As Long
чет нули выдает.... че туда передавать то надо, а то в Api-guide вообще ф-ции нет....GM писал(а):Чтобы узнать сколько процесс весит в памяти:
- Код: Выделить всё
Declare Function GetProcessWorkingSetSize Lib "kernel32.dll" ( _
ByVal hProcess As Long, _
ByRef lpMinimumWorkingSetSize As Long, _
ByRef lpMaximumWorkingSetSize As Long) As Long
Type PROCESS_MEMORY_COUNTERS
cb As Long
PageFaultCount As Long
PeakWorkingSetSize As Long
WorkingSetSize As Long
QuotaPeakPagedPoolUsage As Long
QuotaPagedPoolUsage As Long
QuotaPeakNonPagedPoolUsage As Long
QuotaNonPagedPoolUsage As Long
PagefileUsage As Long
PeakPagefileUsage As Long
End Type
Private Declare Function GetProcessMemoryInfo Lib "PSAPI.DLL" (ByVal hprocess As Long, ppsmemCounters As PROCESS_MEMORY_COUNTERS, ByVal cb As Long) As Long
Function iGetProcessMem(pid As Long) As PROCESS_MEMORY_COUNTERS
Dim hprocess As Long
Dim lRet As Long
Dim pmc As PROCESS_MEMORY_COUNTERS
hprocess = OpenProcess(PROCESS_QUERY_INFORMATION _
Or PROCESS_VM_READ, 0&, pid)
pmc.cb = LenB(pmc)
lRet = GetProcessMemoryInfo(hprocess, pmc, pmc.cb)
CloseHandle (hprocess)
iGetProcessMem = pmc
End Function
Сейчас этот форум просматривают: Yandex-бот и гости: 180