Autoformat
This commit is contained in:
parent
c8810c8683
commit
42d1bfb882
1 changed files with 24 additions and 24 deletions
|
@ -108,17 +108,17 @@ fn create_window() -> Option<HWND> {
|
||||||
}
|
}
|
||||||
|
|
||||||
let window_handle = winuser::CreateWindowExW(0,
|
let window_handle = winuser::CreateWindowExW(0,
|
||||||
atom as winapi::shared::ntdef::LPCWSTR,
|
atom as winapi::shared::ntdef::LPCWSTR,
|
||||||
window_name.as_ptr(),
|
window_name.as_ptr(),
|
||||||
winuser::WS_DISABLED,
|
winuser::WS_DISABLED,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
winuser::GetDesktopWindow(),
|
winuser::GetDesktopWindow(),
|
||||||
std::ptr::null_mut(),
|
std::ptr::null_mut(),
|
||||||
std::ptr::null_mut(),
|
std::ptr::null_mut(),
|
||||||
std::ptr::null_mut());
|
std::ptr::null_mut());
|
||||||
|
|
||||||
if window_handle.is_null() {
|
if window_handle.is_null() {
|
||||||
return None;
|
return None;
|
||||||
|
@ -174,24 +174,23 @@ fn open_notification_context_menu(window: HWND) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
winuser::InsertMenuW(context_menu,
|
winuser::InsertMenuW(context_menu,
|
||||||
0,
|
0,
|
||||||
winuser::MF_STRING,
|
winuser::MF_STRING,
|
||||||
MESSAGE_NOTIFICATION_ICON_QUIT as usize,
|
MESSAGE_NOTIFICATION_ICON_QUIT as usize,
|
||||||
quit_string.as_ptr());
|
quit_string.as_ptr());
|
||||||
|
|
||||||
let mut cursor_position = winapi::shared::windef::POINT { x: 0, y: 0 };
|
let mut cursor_position = winapi::shared::windef::POINT { x: 0, y: 0 };
|
||||||
winuser::GetCursorPos(&mut cursor_position);
|
winuser::GetCursorPos(&mut cursor_position);
|
||||||
|
|
||||||
winuser::SetForegroundWindow(window);
|
winuser::SetForegroundWindow(window);
|
||||||
let flags = winuser::TPM_RIGHTALIGN | winuser::TPM_BOTTOMALIGN |
|
let flags = winuser::TPM_RIGHTALIGN | winuser::TPM_BOTTOMALIGN | winuser::TPM_RIGHTBUTTON;
|
||||||
winuser::TPM_RIGHTBUTTON;
|
|
||||||
winuser::TrackPopupMenu(context_menu,
|
winuser::TrackPopupMenu(context_menu,
|
||||||
flags,
|
flags,
|
||||||
cursor_position.x,
|
cursor_position.x,
|
||||||
cursor_position.y,
|
cursor_position.y,
|
||||||
0,
|
0,
|
||||||
window,
|
window,
|
||||||
std::ptr::null_mut());
|
std::ptr::null_mut());
|
||||||
winuser::PostMessageW(window, 0, 0, 0);
|
winuser::PostMessageW(window, 0, 0, 0);
|
||||||
|
|
||||||
info!("Closing notification context menu");
|
info!("Closing notification context menu");
|
||||||
|
@ -225,7 +224,8 @@ pub fn run() {
|
||||||
unsafe {
|
unsafe {
|
||||||
status = winuser::GetMessageW(&mut message, std::ptr::null_mut(), 0, 0);
|
status = winuser::GetMessageW(&mut message, std::ptr::null_mut(), 0, 0);
|
||||||
if status == -1 {
|
if status == -1 {
|
||||||
panic!("GetMessageW error: {}", winapi::um::errhandlingapi::GetLastError());
|
panic!("GetMessageW error: {}",
|
||||||
|
winapi::um::errhandlingapi::GetLastError());
|
||||||
}
|
}
|
||||||
if status == 0 {
|
if status == 0 {
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Reference in a new issue