From 735df0e5884c16263f1f75628120d8a8e46ae6ea Mon Sep 17 00:00:00 2001 From: lxmou666 <772765102@qq.com> Date: Tue, 16 Feb 2021 12:47:01 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=BB=E7=AC=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Windows/LiveWindowRightBottomBlock.xaml | 1 - .../LiveWindowRightBottomBlock.xaml.cs | 7 ------ .../TRTC/Windows/LiveWindowTopBlock.xaml | 10 +++++++- .../TRTC/Windows/LiveWindowTopBlock.xaml.cs | 25 +++++++++++++++++++ 4 files changed, 34 insertions(+), 9 deletions(-) diff --git a/JianGongYun/TRTC/Windows/LiveWindowRightBottomBlock.xaml b/JianGongYun/TRTC/Windows/LiveWindowRightBottomBlock.xaml index f65052a..87b3795 100644 --- a/JianGongYun/TRTC/Windows/LiveWindowRightBottomBlock.xaml +++ b/JianGongYun/TRTC/Windows/LiveWindowRightBottomBlock.xaml @@ -29,7 +29,6 @@ - diff --git a/JianGongYun/TRTC/Windows/LiveWindowRightBottomBlock.xaml.cs b/JianGongYun/TRTC/Windows/LiveWindowRightBottomBlock.xaml.cs index f49c284..aae8af0 100644 --- a/JianGongYun/TRTC/Windows/LiveWindowRightBottomBlock.xaml.cs +++ b/JianGongYun/TRTC/Windows/LiveWindowRightBottomBlock.xaml.cs @@ -84,12 +84,5 @@ namespace JianGongYun.TRTC.Windows } } - private void Button_Click(object sender, RoutedEventArgs e) - { - Process prc = new Process { StartInfo = new ProcessStartInfo { FileName = System.IO.Path.Combine(Environment.CurrentDirectory, "Pointofix.exe"), CreateNoWindow = false, UseShellExecute = false } }; - prc.Start(); - - huabi.Visibility = Visibility.Collapsed; - } } } diff --git a/JianGongYun/TRTC/Windows/LiveWindowTopBlock.xaml b/JianGongYun/TRTC/Windows/LiveWindowTopBlock.xaml index 9b3d88c..f1f1f38 100644 --- a/JianGongYun/TRTC/Windows/LiveWindowTopBlock.xaml +++ b/JianGongYun/TRTC/Windows/LiveWindowTopBlock.xaml @@ -11,7 +11,7 @@ mc:Ignorable="d" Topmost="True" Top="0" - Title="" Height="40" Width="400" + Title="" Height="40" Width="472" ResizeMode="NoResize" MouseMove="Window_MouseMove" MouseLeave="Window_MouseLeave" @@ -28,6 +28,14 @@ + + + 直播中 diff --git a/JianGongYun/TRTC/Windows/LiveWindowTopBlock.xaml.cs b/JianGongYun/TRTC/Windows/LiveWindowTopBlock.xaml.cs index 35df42f..7c489d6 100644 --- a/JianGongYun/TRTC/Windows/LiveWindowTopBlock.xaml.cs +++ b/JianGongYun/TRTC/Windows/LiveWindowTopBlock.xaml.cs @@ -13,6 +13,7 @@ using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shapes; using Application = System.Windows.Forms.Application; +using MessageBox = System.Windows.MessageBox; using MouseEventArgs = System.Windows.Input.MouseEventArgs; namespace JianGongYun.TRTC.Windows @@ -99,5 +100,29 @@ namespace JianGongYun.TRTC.Windows { down = false; } + private void Button_Click(object sender, RoutedEventArgs e) + { + this.Dispatcher.Invoke(() => + { + try + { + var old = Process.GetProcessesByName("Pointofix"); + if (old.Length > 0) + { + foreach (var item in old) + { + item.Kill(); + } + } + Process prc = new Process { StartInfo = new ProcessStartInfo { FileName = System.IO.Path.Combine(Environment.CurrentDirectory, "Pointofix.exe"), CreateNoWindow = false, UseShellExecute = false } }; + prc.Start(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "提醒"); + } + }); + + } } }