mirror of
https://github.com/ValveSoftware/Proton.git
synced 2025-03-13 14:00:34 +03:00
steam_helper: Add PROTON_HIDE_PROCESS_WINDOW for hiding the child process's window
CW-Bug-Id: #15930
This commit is contained in:
parent
1bac3ae22d
commit
ce2f4327cd
@ -917,6 +917,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 == '"')
|
||||
@ -1022,6 +1023,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.
|
||||
@ -1035,12 +1037,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());
|
||||
|
Loading…
x
Reference in New Issue
Block a user