Skip to content

Commit 875eab3

Browse files
committed
fix: hide PowerShell window during monitor detection (CREATE_NO_WINDOW)
1 parent 27bf49e commit 875eab3

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

launcher/src/modules/monitor.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use crate::config::MonitorConfig;
2+
use std::os::windows::process::CommandExt;
23
use std::process::Command;
34

45
/// Détermine si le launcher doit s'exécuter en mode jeu (`true`) ou bureau (`false`).
@@ -19,6 +20,7 @@ fn detect(name: &str) -> bool {
1920
let cmd = r#"Get-WmiObject -Namespace root\wmi -Class WmiMonitorID | ForEach-Object { ($_.UserFriendlyName | Where-Object {$_} | ForEach-Object {[char]$_}) -join '' }"#;
2021
let output = Command::new("powershell")
2122
.args(["-NoProfile", "-NonInteractive", "-Command", cmd])
23+
.creation_flags(0x08000000)
2224
.output();
2325
match output {
2426
Ok(o) => String::from_utf8_lossy(&o.stdout)

0 commit comments

Comments
 (0)