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
- Showing console window when needed
- 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.2.1"
Or use the command:
cargo add hide_console
Usage
Basic Example
use hide_console;
Showing and Hiding the Console
use ;
use io;
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
# Toggle console visibility
cargo run --example toggle_console
Platforms
- Windows: Full support for hiding and showing console.
- macOS, Linux, and others: The functions don't perform any actions, but don't cause errors.
How It Works
On Windows platform, the library uses WinAPI to hide and show the console window:
- Gets the console window handle using
GetConsoleWindow() - Hides or shows the window using
ShowWindow()with theSW_HIDEorSW_SHOWparameter
On other platforms, the functions simply return 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