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, "提醒"); + } + }); + + } } }