std::wstring ProcessInfo::GetProcessInfo(HANDLE handle) { FILETIME creation = { 0 }; FILETIME exit = { 0 }; FILETIME kernel = { 0 }; FILETIME user = { 0 }; GetProcessTimes(handle, &creation, &exit, &kernel, &user); return WStr(GetTimeText(creation)).str(); }
/** \brief Looks up the time and sets the clock if the current time is * greater than or equal to m_nextUpdate. */ void MythUIClock::Pulse(void) { m_Time = QDateTime::currentDateTime(); if (m_nextUpdate.isNull() || (m_Time >= m_nextUpdate)) MythUIText::SetText(GetTimeText()); MythUIText::Pulse(); }
void OutputDetails(Settings settings, const Line& line) { std::string separator = settings.tabs ? "\t" : " "; if (settings.timestamp) { std::cout << GetTimeText(line.systemTime) << separator; } if (settings.performanceCounter) { std::cout << GetTimeText(line.time) << separator; } if (settings.pid) { std::cout << line.pid << separator; } if (settings.processName) { std::cout << line.processName.c_str() << separator; } }
/** \brief This sets the text, unless the string is blank, in that * case the time is looked up and set as the text instead. */ void MythUIClock::SetText(const QString &text) { QString txt = text; if (txt.isEmpty()) { m_Time = QDateTime::currentDateTime(); txt = GetTimeText(); } MythUIText::SetText(txt); }