You can use the following Windows API to reterive various process
counters in C/C++ program.
It retrieves information about the memory usage of the specified
BOOL WINAPI GetProcessMemoryInfo(
_In_ HANDLE Process,
_Out_ PPROCESS_MEMORY_COUNTERS ppsmemCounters,
_In_ DWORD cb
There is complete example on MSDN, which explains how it can be used to
retrieve such information for your process.
You have mentioned that you would like to fetch the information on
continuous basis(with some time interval as task manager do). To achieve
this you may want to write the complete logic(mentioned in MSDN) inside a
function and call it after some time delay(Sleep(1second)).This
way you should be able to fetch all these information of your program till