-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathmain.cpp
More file actions
36 lines (25 loc) · 750 Bytes
/
main.cpp
File metadata and controls
36 lines (25 loc) · 750 Bytes
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
#include "mainwindow.h"
#include <QApplication>
#ifdef Q_OS_WIN32
#include "singleinstance.h"
#endif
#include <QMessageBox>
#include "utils.h"
int main(int argc, char *argv[]) {
QApplication a(argc, argv);
// a.processEvents();
//{{DCB15209-9E02-489D-9FD6-03689735BD49}}
// QSharedMemory shared("DCB15209-9E02-489D-9FD6-03689735BD49");
// if (!shared.create())
//HANDLE instanceMutex = CreateMutex()
#ifdef Q_OS_WIN32
SingleInstance instance(TEXT("DCB15209-9E02-489D-9FD6-03689735BD49"));
if (instance.isAnotherInstanceRunning()) {
QMessageBox::critical(NULL, "ERROR", "There is a launchpad instance running already, check your system tray!");
return 1;
}
#endif
MainWindow w;
w.show();
return a.exec();
}