-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart.cpp
49 lines (46 loc) · 894 Bytes
/
start.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
#include "start.h"
start::start(RUN r, QObject* parent)
: QObject(parent)
{
myApp = new QProcess(this);
timer = new QTimer(this);
switch (r)
{
case RUN::BEGIN:
dir = R"(bat/run.bat)";
break;
case RUN::TEST:
dir = R"(d:/Users/Administrator/Desktop/run.bat)";
break;
case RUN::CHANGE:
dir = ini->value("initialization/path", R"(bin/GVX.exe)").toString();
ini->setValue("initialization/path", dir);
default: break;
}
if (myApp->startDetached(dir))
{
connect(this->timer, &QTimer::timeout, this, &start::run);
timer->start(700);
}
else exit(0);
// connect(this->timer, &QTimer::timeout, this, &start::run);
// timer->start(700);
}
start::~start()
{
}
void start::run()
{
p = FindWindowA(nullptr, "< - 3D Color Scanner");
fail_p = FindWindowA(nullptr, "HandScan");
if (p)
{
w.newShow();
timer->stop();
}
if (fail_p)
{
w.disShow();
timer->stop();
}
}