Use windows subsystem for this to avoid console window
This commit is contained in:
BIN
auto_mute_gui.exe
Normal file
BIN
auto_mute_gui.exe
Normal file
Binary file not shown.
@@ -1,3 +1,5 @@
|
|||||||
|
#![windows_subsystem = "windows"]
|
||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
collections::HashSet,
|
collections::HashSet,
|
||||||
env,
|
env,
|
||||||
@@ -18,6 +20,10 @@ use windows::Win32::{
|
|||||||
WindowsAndMessaging::{LoadIconW, WM_USER},
|
WindowsAndMessaging::{LoadIconW, WM_USER},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
use windows::{
|
||||||
|
core::*, Win32::{Foundation::*, Graphics::Gdi::ValidateRect, System::LibraryLoader::GetModuleHandleA, UI::WindowsAndMessaging::*},
|
||||||
|
};
|
||||||
|
|
||||||
use windows_core::w;
|
use windows_core::w;
|
||||||
|
|
||||||
const WM_TRAY_MENU: u32 = WM_USER;
|
const WM_TRAY_MENU: u32 = WM_USER;
|
||||||
@@ -151,11 +157,6 @@ fn main() {
|
|||||||
tray.run_loop()
|
tray.run_loop()
|
||||||
}
|
}
|
||||||
|
|
||||||
use windows::{
|
|
||||||
core::*, Win32::Foundation::*, Win32::Graphics::Gdi::ValidateRect,
|
|
||||||
Win32::System::LibraryLoader::GetModuleHandleA, Win32::UI::WindowsAndMessaging::*,
|
|
||||||
};
|
|
||||||
|
|
||||||
extern "system" fn wndproc(hwnd: HWND, message: u32, wparam: WPARAM, lparam: LPARAM) -> LRESULT {
|
extern "system" fn wndproc(hwnd: HWND, message: u32, wparam: WPARAM, lparam: LPARAM) -> LRESULT {
|
||||||
unsafe {
|
unsafe {
|
||||||
let mt = (GetWindowLongPtrW(hwnd, GWLP_USERDATA) as *mut MagicTray).as_mut();
|
let mt = (GetWindowLongPtrW(hwnd, GWLP_USERDATA) as *mut MagicTray).as_mut();
|
||||||
|
|||||||
Reference in New Issue
Block a user