Skip to content

Commit

Permalink
docs: Clarify CREATE_NO_WINDOW usage
Browse files Browse the repository at this point in the history
  • Loading branch information
icorbrey committed Sep 29, 2024
1 parent 9894c89 commit 47ed1c3
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion git2-hooks/src/hookspath.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,16 @@ fn find_default_unix_shell() -> Option<PathBuf> {
}

trait CommandExt {
/// The process is a console application that is being run without a
/// console window. Therefore, the console handle for the application is
/// not set.
///
/// This flag is ignored if the application is not a console application,
/// or if it used with either `CREATE_NEW_CONSOLE` or `DETACHED_PROCESS`.
///
/// See: https://learn.microsoft.com/en-us/windows/win32/procthread/process-creation-flags
const CREATE_NO_WINDOW: u32 = 0x0800_0000;

fn with_no_window(&mut self) -> &mut Self;
}

Expand All @@ -216,7 +226,7 @@ impl CommandExt for Command {
#[cfg(windows)]
{
use std::os::windows::process::CommandExt;
self.creation_flags(0x0800_0000);
self.creation_flags(Self::CREATE_NO_WINDOW);
}

self
Expand Down

0 comments on commit 47ed1c3

Please sign in to comment.