mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-12-18 22:14:20 +01:00
Make CreateProcess() flags depend on "noconsole"
On Windows, display the output of external commands (adb) when a console is available.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "command.h"
|
||||
|
||||
#include "config.h"
|
||||
#include "log.h"
|
||||
#include "strutil.h"
|
||||
|
||||
@@ -20,7 +21,12 @@ HANDLE cmd_execute(const char *path, const char *const argv[]) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!CreateProcess(NULL, cmd, NULL, NULL, FALSE, CREATE_NO_WINDOW, NULL, NULL, &si, &pi)) {
|
||||
#ifdef WINDOWS_NOCONSOLE
|
||||
int flags = CREATE_NO_WINDOW;
|
||||
#else
|
||||
int flags = 0;
|
||||
#endif
|
||||
if (!CreateProcess(NULL, cmd, NULL, NULL, FALSE, flags, NULL, NULL, &si, &pi)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user