feat: vpn hide console

This commit is contained in:
arm64v8a
2022-09-17 12:05:23 +08:00
parent 96d352b19f
commit acab650833
8 changed files with 35 additions and 7 deletions

View File

@@ -44,7 +44,8 @@ Returns the return value of the executed command
*/
uint WinCommander::runProcessElevated(const QString &path,
const QStringList &parameters,
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 &parameters, const QString &workingDir,
bool aWait) {
return runProcessElevated(path, QStringList() << parameters, workingDir, aWait);
bool hide, bool aWait) {
return runProcessElevated(path, QStringList() << parameters, workingDir, hide, aWait);
}