Sandboxie/SandboxiePlus/SandMan/main.cpp

51 lines
1.2 KiB
C++
Raw Normal View History

2020-06-01 17:11:56 +01:00
#include "stdafx.h"
#include "SandMan.h"
#include <QtWidgets/QApplication>
#include "../QSbieAPI/SbieAPI.h"
2020-06-08 16:17:37 +01:00
#include "../QtSingleApp/src/qtsingleapplication.h"
#include "../QSbieAPI/SbieUtils.h"
2020-06-18 16:44:29 +01:00
#include "../MiscHelpers/Common/qRC4.h"
#include "../MiscHelpers/Common/Common.h"
#include <windows.h>
2020-06-01 17:11:56 +01:00
CSettings* theConf = NULL;
int main(int argc, char *argv[])
{
2020-06-18 16:44:29 +01:00
#ifdef Q_OS_WIN
SetProcessDPIAware();
#endif // Q_OS_WIN
//QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
//QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling);
2020-06-08 16:17:37 +01:00
QtSingleApplication app(argc, argv);
2020-06-18 16:44:29 +01:00
//InitConsole(false);
2020-06-08 16:17:37 +01:00
SB_STATUS Status = CSbieUtils::DoAssist();
if (Status.GetStatus()) {
app.sendMessage("Status:" + Status.GetText());
return 0;
}
if (app.sendMessage("ShowWnd"))
return 0;
2020-06-01 17:11:56 +01:00
theConf = new CSettings("Sandboxie-Plus");
//QThreadPool::globalInstance()->setMaxThreadCount(theConf->GetInt("Options/MaxThreadPool", 10));
CSandMan* pWnd = new CSandMan();
2020-06-08 16:17:37 +01:00
QObject::connect(&app, SIGNAL(messageReceived(const QString&)), pWnd, SLOT(OnMessage(const QString&)));
2020-06-01 17:11:56 +01:00
int ret = app.exec();
delete pWnd;
delete theConf;
theConf = NULL;
return ret;
}