Now I'am working on a MFC program. What I want to know is the speed a process receive/send to the network. Suppose I have a process named chrome.exe, it may receive 1008B/s, send 2987B/s. I know I can get what I want in the Win 7 Resource Monitor. But how can I get those data in my program. Dose MFC or Win32api support th开发者_如何学Gois?
You can obtain this information, as well as a wealth of other performance data using WMI:
Monitoring Performance Data
This class is probably what you are looking for:
Win32_PerfFormattedData_Tcpip_NetworkInterface
From a native C++/MFC application, you'll access WMI through some COM interfaces
Have fun!
精彩评论