mirror of
https://github.com/MatsuriDayo/nekoray.git
synced 2025-12-18 04:54:38 +03:00
feat: vpn hide console
This commit is contained in:
9
3rdparty/WinCommander.cpp
vendored
9
3rdparty/WinCommander.cpp
vendored
@@ -44,7 +44,8 @@ Returns the return value of the executed command
|
||||
*/
|
||||
uint WinCommander::runProcessElevated(const QString &path,
|
||||
const QStringList ¶meters,
|
||||
const QString &workingDir, bool aWait) {
|
||||
const QString &workingDir,
|
||||
bool hide, bool aWait) {
|
||||
uint result = 0;
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
@@ -75,7 +76,7 @@ uint WinCommander::runProcessElevated(const QString &path,
|
||||
shex.lpParameters = pszParameters;
|
||||
shex.lpDirectory = pszDirectory;
|
||||
// https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-showwindow
|
||||
shex.nShow = SW_SHOWMINIMIZED;
|
||||
shex.nShow = hide ? SW_HIDE : SW_SHOWMINIMIZED;
|
||||
|
||||
ShellExecuteEx(&shex);
|
||||
if (shex.hProcess)
|
||||
@@ -109,6 +110,6 @@ execution or wait for the exit of the launched process
|
||||
Returns the return value of the executed command
|
||||
*/
|
||||
uint WinCommander::runProcessElevated(const QString &path, const QString ¶meters, const QString &workingDir,
|
||||
bool aWait) {
|
||||
return runProcessElevated(path, QStringList() << parameters, workingDir, aWait);
|
||||
bool hide, bool aWait) {
|
||||
return runProcessElevated(path, QStringList() << parameters, workingDir, hide, aWait);
|
||||
}
|
||||
|
||||
4
3rdparty/WinCommander.hpp
vendored
4
3rdparty/WinCommander.hpp
vendored
@@ -31,12 +31,12 @@ public:
|
||||
static uint runProcessElevated(const QString &path,
|
||||
const QStringList ¶meters = QStringList(),
|
||||
const QString &workingDir = QString(),
|
||||
bool aWait = true);
|
||||
bool hide = false, bool aWait = true);
|
||||
|
||||
static uint runProcessElevated(const QString &path,
|
||||
const QString ¶meters = QString(),
|
||||
const QString &workingDir = QString(),
|
||||
bool aWait = true);
|
||||
bool hide = false, bool aWait = true);
|
||||
};
|
||||
|
||||
#endif // WINCOMMANDER_H
|
||||
Reference in New Issue
Block a user