1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//! Helpers for spawning child processes without showing a console window
//! flash on Windows. See issue #138.
use Command;
/// `CREATE_NO_WINDOW` from `winbase.h`. Suppresses the flash of a console
/// window when the GUI app spawns a console subprocess (powershell.exe,
/// cmd.exe, reg.exe, sc.exe, wevtutil.exe, dsregcmd.exe, etc.).
const CREATE_NO_WINDOW: u32 = 0x0800_0000;
/// Build a `Command` for `program` that, on Windows, won't pop a console
/// window. On other platforms behaves identically to `Command::new`.
/// Apply the no-window flag to an existing `Command`. Useful when callers
/// already have a `Command` they need to flag (e.g. when a builder pattern
/// fits better than `hidden_command`).