-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQMPPID.h
54 lines (41 loc) · 881 Bytes
/
QMPPID.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef QMPPID_H
#define QMPPID_H
#include <QtGlobal>
#include <QString>
#if defined(Q_OS_WIN)
# include <Windows.h>
# include <tlhelp32.h>
# include <Psapi.h>
class QMPPID
{
QMPPID();
static bool IS_INITIALIZED;
static bool IS_RUNNING_THROUGH_CREATOR;
static DWORD getParentPID(DWORD pid);
static int getProcessName(DWORD pid, QString &name);
public:
static bool getIsRunningThroughCreator();
};
#elif defined(Q_OS_LINUX)
# include <stdio.h>
# include <unistd.h>
# include <string.h>
# include <stdlib.h>
class QMPPID
{
QMPPID();
static bool IS_INITIALIZED;
static bool IS_RUNNING_THROUGH_CREATOR;
static pid_t getParentPID(pid_t pid);
static int getProcessName(pid_t pid, QString &name);
public:
static bool getIsRunningThroughCreator();
};
#else
class MPPID
{
public:
MPPID();
};
#endif
#endif // QMPPID_H