GetProcessTimes
The GetProcessTimes function obtains timing information about a specified process.
BOOL GetProcessTimes(
HANDLE hProcess, // specifies the process of interest
LPFILETIME lpCreationTime, // when the process was created
LPFILETIME lpExitTime, // when the process exited
LPFILETIME lpKernelTime, // time the process has spent in kernel
// mode
LPFILETIME lpUserTime // time the process has spent in user mode
);
hwo to Create and kill a process, you can see codeproject example:
http://www.codeproject.com/cpp/kill_process.asp
//in this article,when you quit the process,
if(::WaitForSingleObject(m_hPro,m_nTimeOut)==WAIT_OBJECT_0)
{
AfxMessageBox("the Process is go over");
}
CloseHandle(m_hPro);
m_nTimeOut is you want