Win32 获取进程占用的内存信息

主要用到的函数

GetWindowThreadProceddId(m_hWnd, &dwProcessID);

HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, NULL, dwProcessID);

PROCESS_MEMORY_CONTERS process_mem_counters = {0};

process_mem_counters.cb = sizeof(PROCESS_MEMORY_CONTERS);

DWORD bRet = GetProcessMemoryInfo(hProcess, &process_mem_counters,sizeof(PROCESS_MEMORY_CONETERS));

process_mem_counters.WorkingSetSIze / 1024 就是设备管理器里面的内存使用。


你可能感兴趣的:(Win32,Process,Memory)