Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QM Memory
#6
Function GetProcessMemoryUsage
Code:
Copy      Help
;/
function# pid

;Returns process memory usage, KB.
;It is what you see in Task Manager, "Commit Size" column. Or in Process Hacker, "Private bytes" column.

;pid - process id. See <help>ProcessNameToId</help>, <google>GetWindowThreadProcessId</google>.


__Handle hp=OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION|PROCESS_VM_READ 0 pid)
if(hp=0) end ES_FAILED 16

PROCESS_MEMORY_COUNTERS z.cb=sizeof(z)
if GetProcessMemoryInfo(hp &z sizeof(z))
,ret z.PagefileUsage/1024


Messages In This Thread

Forum Jump:


Users browsing this thread: 7 Guest(s)