It's not entirely clear whether you're trying to have the process monitor itself, or have one process monitoring another. In the first case, you want to put your monitoring in a separate thread to keep it from bringing the rest of the program to a halt.
SLaks has already covered getting CPU usage, so I won't repeat that.
You can get information about the blocks of memory allocated to a process with VirtualQuery
or VirtualQueryEx
(VirtualQuery
to query the process' own memory, VirtualQueryEx
to look at another process). At least for the first attempt, I'd count the private pages as the ones allocated by a particular process.