diff options
| author | Fuwn <[email protected]> | 2022-12-29 10:58:59 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2022-12-29 10:58:59 +0000 |
| commit | 6074be927ebe6cce98f95c0b4b040cdc7fe6408a (patch) | |
| tree | ea6c589ada7e9b4424832bb70d0d3d677839c94f | |
| parent | feat: hide/show log window (diff) | |
| download | elem-0.1.3.tar.xz elem-0.1.3.zip | |
feat(main.rs): remove buttons from log windowv0.1.3
| -rw-r--r-- | Cargo.toml | 2 | ||||
| -rw-r--r-- | src/main.rs | 20 |
2 files changed, 19 insertions, 3 deletions
@@ -2,7 +2,7 @@ [package] name = "elem" -version = "0.1.2" +version = "0.1.3" authors = ["Fuwn <[email protected]>"] edition = "2021" description = "Logitech Battery Level Tray Indicator" diff --git a/src/main.rs b/src/main.rs index 0a685bf..00e7bc0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -35,12 +35,28 @@ mod tray; #[macro_use] extern crate log; -use winapi::{um, um::winuser}; +use winapi::{ + um, + um::{wincon, winuser}, +}; fn main() { unsafe { um::consoleapi::AllocConsole(); - winuser::ShowWindow(um::wincon::GetConsoleWindow(), winuser::SW_HIDE); + + winuser::SetWindowLongPtrW( + wincon::GetConsoleWindow(), + winuser::GWL_STYLE, + #[allow(clippy::cast_possible_wrap)] + { + winuser::GetWindowLongPtrW( + wincon::GetConsoleWindow(), + winuser::GWL_STYLE, + ) & !winuser::WS_SYSMENU as isize + }, + ); + + winuser::ShowWindow(wincon::GetConsoleWindow(), winuser::SW_HIDE); std::env::set_var("RUST_LOG", "elem=trace"); pretty_env_logger::init(); info!("starting elem"); |