Hide Console
A library for hiding console windows in Rust applications. Perfect for creating background applications or applications with graphical interface without visible console window.
Features
- Hiding console window on Windows platform
- Cross-platform support (works safely on all platforms)
- Minimal dependencies
- Simple and clear API
Documentation
Full documentation is available at docs.rs/hide_console.
Installation
Add to your Cargo.toml:
[]
= "0.1.0"
Or use the command:
cargo add hide_console
Usage
Basic Example
use hide_console;
Checking Console Hiding Support
use is_hide_console_supported;
Examples
The library contains several examples that you can run:
# Simple console hiding example
cargo run --example simple
# GUI application emulation
cargo run --example gui_emulation
Platforms
- Windows: Full support for hiding console.
- macOS, Linux, and others: The
hide_console()function doesn't perform any actions, but doesn't cause errors.
How It Works
On Windows platform, the library uses WinAPI to hide the console window:
- Gets the console window handle using
GetConsoleWindow() - Hides the window using
ShowWindow()with theSW_HIDEparameter
On other platforms, the hide_console() function simply returns without performing any actions.
License
MIT
Contributing
Contributions are welcome! Please submit pull requests or create issues on GitHub.
Social Media
twitch.tv/mloccy_
t.me/mloccy