I have a tauri application that can receive file drag and drop messages when launched with standard permissions.
But when I started with administrator privileges, I was unable to receive messages. I followed the implementation method of other applications and proactively modified the Win32 message filter. But still ineffective
mycode
.setup(| app | {
let window: Window = app.get_window(MAIN_LABEL).unwrap();
let hwnd = window.hwnd().expect("Failed to get HWND").0 as *mut _;
app.listen_global("app-exist", move |_| app_exist(Some(&window)));
let success = unsafe { ChangeWindowMessageFilterEx(hwnd, WM_DROPFILES, 1, std::ptr::null_mut()) };
if success == 0 {
panic!("Failed to change message filter for WM_DROPFILES");
}
let success = unsafe { ChangeWindowMessageFilterEx(hwnd, WM_COPYDATA, 1, std::ptr::null_mut()) };
if success == 0 {
panic!("Failed to change message filter for WM_COPYDATA");
}
let success = unsafe { ChangeWindowMessageFilterEx(hwnd, 0x0049, 1, std::ptr::null_mut()) };
if success == 0 {
panic!("Failed to change message filter for 0x0049");
}
Ok(())
})
Describe the bug
I have a tauri application that can receive file drag and drop messages when launched with standard permissions.
But when I started with administrator privileges, I was unable to receive messages. I followed the implementation method of other applications and proactively modified the Win32 message filter. But still ineffective
mycode
What should I do?
Reproduction
No response
Expected behavior
4
Full
tauri info
outputStack trace
Additional context
1