Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking issue for CommandExt::show_window #127544

Open
1 of 3 tasks
andyolivares opened this issue Jul 10, 2024 · 2 comments
Open
1 of 3 tasks

Tracking issue for CommandExt::show_window #127544

andyolivares opened this issue Jul 10, 2024 · 2 comments
Labels
C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@andyolivares
Copy link
Contributor

andyolivares commented Jul 10, 2024

Feature gate: #![feature(windows_process_extensions_show_window)]

This is a tracking issue for #126690.

The idea is to expose STARTUPINFOW.wShowWindow in CommandExt trait to control how a new process' window is displayed on Windows OS (normal, minimized, maximized, etc.)

Public API

// std::os::windows::process

#[stable(feature = "windows_process_extensions", since = "1.16.0")]
pub trait CommandExt: Sealed {
  #[unstable(feature = "windows_process_extensions_show_window", issue = "127544")]
  fn show_window(&mut self, cmd_show: u16) -> &mut process::Command;
}

Steps / History

Unresolved Questions

  • None yet.

Footnotes

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html

@andyolivares andyolivares added C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Jul 10, 2024
@BlackHoleFox
Copy link
Contributor

+1 for this in std. Had a use case for this managing processes on a desktop OS and this was a infinitely cleaner option compared to rolling my own, correct, CreateProcessW code just to set a single flag.

@andyolivares
Copy link
Contributor Author

I've been using this myself in a production app with no issues since the feature was merged to master. I don't think a simple flag can cause much trouble :)

Can @dtolnay help us on stabilizing this feature? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants