aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2022-12-29 10:58:59 +0000
committerFuwn <[email protected]>2022-12-29 10:58:59 +0000
commit6074be927ebe6cce98f95c0b4b040cdc7fe6408a (patch)
treeea6c589ada7e9b4424832bb70d0d3d677839c94f
parentfeat: hide/show log window (diff)
downloadelem-6074be927ebe6cce98f95c0b4b040cdc7fe6408a.tar.xz
elem-6074be927ebe6cce98f95c0b4b040cdc7fe6408a.zip
feat(main.rs): remove buttons from log windowv0.1.3
-rw-r--r--Cargo.toml2
-rw-r--r--src/main.rs20
2 files changed, 19 insertions, 3 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 4009ac3..7e57dfd 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -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");