mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
println in winmain
This commit is contained in:
@@ -48,7 +48,7 @@ pub fn breakdown_callback() {
|
||||
pub fn change_resolution(name: &str, width: usize, height: usize) -> ResultType<()> {
|
||||
let cur_resolution = current_resolution(name)?;
|
||||
// For MacOS
|
||||
// to-do: Make sure the following comparison works.
|
||||
// to-do: Make sure the following comparison works.
|
||||
// For Linux
|
||||
// Just run "xrandr", dpi may not be taken into consideration.
|
||||
// For Windows
|
||||
|
||||
@@ -2297,3 +2297,26 @@ mod tests {
|
||||
assert_eq!(chr, None)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn message_box(text: &str) {
|
||||
let mut text = text.to_owned();
|
||||
if !text.ends_with("!") {
|
||||
use arboard::Clipboard as ClipboardContext;
|
||||
match ClipboardContext::new() {
|
||||
Ok(mut ctx) => {
|
||||
ctx.set_text(&text).ok();
|
||||
text = format!("{}\n\nAbove text has been copied to clipboard", &text);
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
let text = text
|
||||
.encode_utf16()
|
||||
.chain(std::iter::once(0))
|
||||
.collect::<Vec<u16>>();
|
||||
let caption = "RustDesk Output"
|
||||
.encode_utf16()
|
||||
.chain(std::iter::once(0))
|
||||
.collect::<Vec<u16>>();
|
||||
unsafe { MessageBoxW(std::ptr::null_mut(), text.as_ptr(), caption.as_ptr(), MB_OK) };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user