#include "osutil.h" #include #include #include #include #define WIN32_LEAN_AND_MEAN #include #include "processinfo.h" OsUtil::OsUtil(QObject *parent) : QObject(parent) { } void OsUtil::setClipboardData(const QVariant &data) { QClipboard *clipboard = QApplication::clipboard(); switch (data.type()) { case QVariant::Pixmap: clipboard->setPixmap(data.value()); break; case QVariant::Image: clipboard->setImage(data.value()); break; default: clipboard->setText(data.toString()); } } QString OsUtil::pidToKernelPath(quint32 pid) { const ProcessInfo pi(pid); return pi.kernelPath(); } bool OsUtil::createGlobalMutex(const char *name) { return !CreateMutexA(NULL, FALSE, name); }