summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/process.cpp15
-rw-r--r--src/utils/process.h2
2 files changed, 17 insertions, 0 deletions
diff --git a/src/utils/process.cpp b/src/utils/process.cpp
index b424b42e3..1efd850cc 100644
--- a/src/utils/process.cpp
+++ b/src/utils/process.cpp
@@ -257,3 +257,18 @@ bool openBrowser(std::string url)
}
#endif
+
+#ifdef WIN32
+void setPriority(const bool big)
+{
+ HANDLE hCurrentProcess = GetCurrentProcess();
+ if (big)
+ SetPriorityClass(hCurrentProcess, ABOVE_NORMAL_PRIORITY_CLASS);
+ else
+ SetPriorityClass(hCurrentProcess, BELOW_NORMAL_PRIORITY_CLASS);
+}
+#else
+void setPriority(const bool big A_UNUSED)
+{
+}
+#endif
diff --git a/src/utils/process.h b/src/utils/process.h
index 6b34fd22d..95c868372 100644
--- a/src/utils/process.h
+++ b/src/utils/process.h
@@ -31,4 +31,6 @@ bool execFile(std::string pathName, std::string name,
bool openBrowser(std::string url);
+void setPriority(const bool big);
+
#endif // UTILS_PROCESS_H