autostart: add start minimized to commandline options
Refs #74811
Change-Id: Ia1c6929c2b46dc9815692e9dfe8be7350064fc90
diff --git a/main.cpp b/main.cpp
index 861bcd5..35f390c 100644
--- a/main.cpp
+++ b/main.cpp
@@ -50,7 +50,18 @@
}
MainWindow w;
- w.show();
+
+ auto startMinimized = false;
+
+ for (auto string : QCoreApplication::arguments()) {
+ if (string == "-m" || string == "--minimized")
+ startMinimized = true;
+ }
+
+ if (not startMinimized)
+ w.show();
+ else
+ w.showMinimized();
QObject::connect(&a, &QApplication::aboutToQuit, [&a]() {
delete CallModel::instance();
diff --git a/utils.cpp b/utils.cpp
index 645fe0f..7e80f3b 100644
--- a/utils.cpp
+++ b/utils.cpp
@@ -46,6 +46,7 @@
{
IPersistFile* ppf;
psl->SetPath(lpszPathObj);
+ psl->SetArguments(TEXT("--minimized"));
hres = psl->QueryInterface(IID_IPersistFile, (LPVOID*)&ppf);
if (SUCCEEDED(hres))