You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Cigarette/Cigarette/main.cpp

50 lines
1.1 KiB
C++

#include "cigarette.h"
#include <QtWidgets/QApplication>
#include <QPixmap>
#include <QSplashScreen>
#include <Windows.h>
#include <qmessagebox.h>
#if defined LICENSE_VERIFY
#pragma comment(lib,"CryptoToolLib.lib")
#include "CryptoToolLib.h"
#endif
int main(int argc, char* argv[])
{
QApplication a(argc, argv);
HANDLE hMutex = NULL;
hMutex = CreateMutex(nullptr, TRUE, L"CigratteShanghai");
if ((GetLastError() == ERROR_ALREADY_EXISTS) || (hMutex == NULL)) {
QMessageBox::warning(nullptr, "Error", "An instance of the application is already running.");
CloseHandle(hMutex);
hMutex = NULL;
a.closeAllWindows();
return 0;
}
#if defined LICENSE_VERIFY
if (!VerifyLicense())
{
exit(0);
}
#endif
qRegisterMetaType<cv::Mat>("cv::Mat");
QPixmap pixmap("D:/Release/splash.jpg");
QSplashScreen splash(pixmap);
splash.show();
a.processEvents();
Cigarette w;
w.show();
//w.showFullScreen();
splash.finish(&w);
a.exec();
if (hMutex != NULL) {
CloseHandle(hMutex);
hMutex = NULL;
}
return 0;
}