-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
79 lines (63 loc) · 1.63 KB
/
main.cpp
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#include <QApplication>
#include <QTest>
#include <QProcess>
#include <apgtask.h>
#include <eikenv.h>
#include <aknnotewrappers.h>
int main(int argc, char *argv[])
{
bool running = false;
TFullName res;
TFindProcess find;
while(find.Next(res) == KErrNone)
{
RProcess ph;
ph.Open(res);
if(ph.SecureId() == 0x2002B30D)
if (ph.ExitType() == EExitPending)
{
running = true;
break;
}
ph.Close();
}
if (running == false)
{
QProcess *myProcess = new QProcess;
myProcess->start("whatsapp.exe");
}
else {
QApplication app(argc, argv);
CAknConfirmationNote* run = new (ELeave) CAknConfirmationNote;
QT_TRAP_THROWING(run->ExecuteLD(_L("Closed WhatsApp")));
TFullName res1;
TFindProcess find1(_L("*[2002B306]*"));
while(find1.Next(res1) == KErrNone)
{
RProcess ph1;
ph1.Open(find1);
ph1.Kill(KErrNone);
ph1.Close();
}
TFullName res2;
TFindProcess find2(_L("*[2002B310]*"));
while(find2.Next(res2) == KErrNone)
{
RProcess ph2;
ph2.Open(find2);
ph2.Kill(KErrNone);
ph2.Close();
}
TFullName res3;
TFindProcess find3(_L("*[2002B30D]*"));
while(find3.Next(res3) == KErrNone)
{
RProcess ph3;
ph3.Open(find3);
ph3.Kill(KErrNone);
ph3.Close();
}
QTest::qWait(1500);
}
return 1;
}