diff options
| author | Fuwn <[email protected]> | 2022-12-29 09:55:35 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2022-12-29 09:55:35 +0000 |
| commit | 9b4b68452e69f9ca59af4d251b0bb147330d4a0c (patch) | |
| tree | b3050a6f6b7e4ea63986ea43d87313a00267f1ee /src/main.rs | |
| parent | docs(README.md): add example usage gif (diff) | |
| download | elem-0.1.2.tar.xz elem-0.1.2.zip | |
feat: hide/show log windowv0.1.2
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/main.rs b/src/main.rs index 307ece4..0a685bf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -21,12 +21,12 @@ unused, future_incompatible, rust_2018_idioms, - unsafe_code, clippy::all, clippy::nursery, clippy::pedantic )] #![recursion_limit = "128"] +#![windows_subsystem = "windows"] mod ascii_art; mod logitech; @@ -35,9 +35,15 @@ mod tray; #[macro_use] extern crate log; +use winapi::{um, um::winuser}; + fn main() { - std::env::set_var("RUST_LOG", "elem=trace"); - pretty_env_logger::init(); - info!("starting elem"); - tray::Tray::new(std::env::args().nth(1)).run(); + unsafe { + um::consoleapi::AllocConsole(); + winuser::ShowWindow(um::wincon::GetConsoleWindow(), winuser::SW_HIDE); + std::env::set_var("RUST_LOG", "elem=trace"); + pretty_env_logger::init(); + info!("starting elem"); + tray::Tray::new(std::env::args().nth(1)).run(); + } } |