diff --git a/steam_helper/steam.cpp b/steam_helper/steam.cpp index 5cad86c6..3cad4e69 100644 --- a/steam_helper/steam.cpp +++ b/steam_helper/steam.cpp @@ -880,6 +880,7 @@ static HANDLE run_process(BOOL *should_await) PROCESS_INFORMATION pi; DWORD flags = CREATE_UNICODE_ENVIRONMENT; BOOL use_shell_execute = TRUE; + BOOL hide_window; /* skip argv[0] */ if (*cmdline == '"') @@ -985,6 +986,7 @@ run: SetConsoleCtrlHandler( console_ctrl_handler, TRUE ); use_shell_execute = should_use_shell_execute(cmdline); + hide_window = env_nonzero("PROTON_HIDE_PROCESS_WINDOW"); /* only await the process finishing if we launch a process directly... * Steam simply calls ShellExecuteA with the same parameters. @@ -998,12 +1000,18 @@ run: if (use_shell_execute) { static const WCHAR verb[] = { 'o', 'p', 'e', 'n', 0 }; - ShellExecuteW(NULL, verb, cmdline, NULL, NULL, SW_SHOWNORMAL); + ShellExecuteW(NULL, verb, cmdline, NULL, NULL, hide_window ? SW_HIDE : SW_SHOWNORMAL); return INVALID_HANDLE_VALUE; } else { + if (hide_window) + { + si.dwFlags |= STARTF_USESHOWWINDOW; + si.wShowWindow = SW_HIDE; + } + if (!CreateProcessW(NULL, cmdline, NULL, NULL, FALSE, flags, NULL, NULL, &si, &pi)) { WINE_ERR("Failed to create process %s: %u\n", wine_dbgstr_w(cmdline), GetLastError());