pinready 0.24.1

Cross-platform configurator and launcher supporting the adoption of Visual Pinball 10.8.1 — for testers and early adopters, not a replacement for a stable production setup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Windows: helper programs started without a console window.
//!
//! PinReady is a GUI program, so Windows gives each console program it
//! starts (PowerShell) a console of its own, which pops up on screen for as
//! long as the child runs. `CREATE_NO_WINDOW` starts it with none.

use std::os::windows::process::CommandExt;
use std::process::Command;

/// `CREATE_NO_WINDOW` process creation flag.
const CREATE_NO_WINDOW: u32 = 0x0800_0000;

/// `powershell`, run without a console window.
pub fn powershell() -> Command {
    let mut cmd = Command::new("powershell");
    cmd.creation_flags(CREATE_NO_WINDOW);
    cmd
}