Browse Source

zhao:1录屏批注增加topmost

tags/录制修改前
耀 4 years ago
parent
commit
97923bdded

+ 2
- 2
XHWK.WKTool/App.config View File

33
     <!--上传每片大小 Mb-->
33
     <!--上传每片大小 Mb-->
34
     <add key="UploadSliceLen" value="1" />
34
     <add key="UploadSliceLen" value="1" />
35
     <!--版本号-->
35
     <!--版本号-->
36
-    <add key="VersionCode" value="23" />
37
-    <add key="VersionName" value="1.2.2" />
36
+    <add key="VersionCode" value="24" />
37
+    <add key="VersionName" value="1.2.3" />
38
     <add key="ClientSettingsProvider.ServiceUri" value="" />
38
     <add key="ClientSettingsProvider.ServiceUri" value="" />
39
   </appSettings>
39
   </appSettings>
40
   <system.web>
40
   <system.web>

+ 30
- 1
XHWK.WKTool/JieTuWindow.xaml.cs View File

50
 
50
 
51
         private double _X0 = 0;
51
         private double _X0 = 0;
52
         private double _Y0 = 0;
52
         private double _Y0 = 0;
53
-
53
+        /// <summary>
54
+        /// 键盘钩子
55
+        /// </summary>
56
+        private KeyboardHookCommon k_hook;
54
         //private IntPtr BitmapPtr = IntPtr.Zero;
57
         //private IntPtr BitmapPtr = IntPtr.Zero;
55
         //private IntPtr JieTuBitmapPtr = IntPtr.Zero;
58
         //private IntPtr JieTuBitmapPtr = IntPtr.Zero;
56
         /// <summary>
59
         /// <summary>
60
         {
63
         {
61
             _Current = this;
64
             _Current = this;
62
             InitializeComponent();
65
             InitializeComponent();
66
+            k_hook = new KeyboardHookCommon();
67
+            k_hook.KeyDownEvent += K_hook_KeyDownEvent;
63
             DataContext = new AppModel();
68
             DataContext = new AppModel();
64
             initialization();
69
             initialization();
65
             Screenshot();
70
             Screenshot();
102
             DataContext = new AppModel();
107
             DataContext = new AppModel();
103
             WpfHelper.MainDispatcher = Dispatcher;
108
             WpfHelper.MainDispatcher = Dispatcher;
104
         }
109
         }
110
+        /// <summary>
111
+        /// 初始化快捷键
112
+        /// </summary>
113
+        public void InitializeKeyDownEvent()
114
+        {
115
+          
116
+            k_hook.Start();//安装键盘钩子
117
+        }
118
+        /// <summary>
119
+        /// 快捷键
120
+        /// </summary>
121
+        /// <param name="sender"></param>
122
+        /// <param name="e"></param>
123
+        private void K_hook_KeyDownEvent(object sender, System.Windows.Forms.KeyEventArgs e)
124
+        {
125
+            if (e.KeyValue == (int)System.Windows.Forms.Keys.Escape)
126
+            {
127
+                k_hook.Stop();
128
+                Current.OnCancel();
129
+                APP.W_XHMicroLessonSystemWindow.InitializeKeyDownEvent();
130
+                this.Hide();
131
+            }
132
+        }
105
 
133
 
106
         #region 属性 Current
134
         #region 属性 Current
107
 
135
 
295
             //this.Hide();
323
             //this.Hide();
296
             if (ChangeTextEvent != null)
324
             if (ChangeTextEvent != null)
297
             {
325
             {
326
+                k_hook.Stop();
298
                 ChangeTextEvent("关闭窗口");
327
                 ChangeTextEvent("关闭窗口");
299
             }
328
             }
300
         }
329
         }

+ 2
- 0
XHWK.WKTool/PracticeWindow.xaml.cs View File

83
             };
83
             };
84
 
84
 
85
             DataContext = viewModel;
85
             DataContext = viewModel;
86
+            //APP.W_ScreenRecordingToolbarWindow.Owner = this;
87
+            //APP.W_ScreenRecordingToolbarWindow.Topmost = true;
86
         }
88
         }
87
         /// <summary>
89
         /// <summary>
88
         /// 画笔颜色事件 白色
90
         /// 画笔颜色事件 白色

+ 2
- 2
XHWK.WKTool/Properties/AssemblyInfo.cs View File

49
 //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
49
 //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
50
 //通过使用 "*",如下所示:
50
 //通过使用 "*",如下所示:
51
 // [assembly: AssemblyVersion("1.0.*")]
51
 // [assembly: AssemblyVersion("1.0.*")]
52
-[assembly: AssemblyVersion("1.2.2.0")]
53
-[assembly: AssemblyFileVersion("1.2.2.0")]
52
+[assembly: AssemblyVersion("1.2.3.0")]
53
+[assembly: AssemblyFileVersion("1.2.3.0")]

+ 1
- 0
XHWK.WKTool/ScreenRecordingToolbarWindow.xaml View File

6
         xmlns:local="clr-namespace:XHWK.WKTool"
6
         xmlns:local="clr-namespace:XHWK.WKTool"
7
         mc:Ignorable="d"
7
         mc:Ignorable="d"
8
         Title="ScreenRecordingToolbarWindow" Height="450" Width="300" AllowsTransparency="True" 
8
         Title="ScreenRecordingToolbarWindow" Height="450" Width="300" AllowsTransparency="True" 
9
+        Topmost="True"
9
     ShowInTaskbar="False"
10
     ShowInTaskbar="False"
10
     WindowStartupLocation="CenterOwner"
11
     WindowStartupLocation="CenterOwner"
11
     WindowStyle="None" Margin="0" Left="0" Top="0">
12
     WindowStyle="None" Margin="0" Left="0" Top="0">

+ 22
- 11
XHWK.WKTool/ScreenRecordingToolbarWindow.xaml.cs View File

260
             #region 防止连击
260
             #region 防止连击
261
             if (IsPressButton)
261
             if (IsPressButton)
262
             {
262
             {
263
-                new Thread(new ThreadStart(new Action(() =>
264
-                {
265
-                    Thread.Sleep(500);
266
-                    IsPressButton = false;
267
-                }))).Start();
268
                 return;
263
                 return;
269
             }
264
             }
270
             else
265
             else
271
             {
266
             {
272
                 IsPressButton = true;
267
                 IsPressButton = true;
268
+                new Thread(new ThreadStart(new Action(() =>
269
+                {
270
+                    Thread.Sleep(500);
271
+                    IsPressButton = false;
272
+                }))).Start();
273
             }
273
             }
274
             #endregion
274
             #endregion
275
             if (IsSuspend)
275
             if (IsSuspend)
368
                 txbTime.Visibility = Visibility.Visible;//时间显示
368
                 txbTime.Visibility = Visibility.Visible;//时间显示
369
                 //imgReturn.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar30.png"));
369
                 //imgReturn.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar30.png"));
370
                 //borOne.Background = new SolidColorBrush(Colors.LightBlue);
370
                 //borOne.Background = new SolidColorBrush(Colors.LightBlue);
371
-                //btnReturn.IsEnabled = false;//返回主界面可点击
372
 
371
 
373
                 try
372
                 try
374
                 {
373
                 {
427
                 txbTime.Visibility = Visibility.Hidden;//时间不显示
426
                 txbTime.Visibility = Visibility.Hidden;//时间不显示
428
                 //imgReturn.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar29.png"));
427
                 //imgReturn.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar29.png"));
429
                 //btnReturn.IsEnabled = true;//返回主界面可点击
428
                 //btnReturn.IsEnabled = true;//返回主界面可点击
429
+
430
                 #region 2秒内不可点击
430
                 #region 2秒内不可点击
431
                 new Thread(new ThreadStart(new Action(() =>
431
                 new Thread(new ThreadStart(new Action(() =>
432
                 {
432
                 {
465
             #region 防止连击
465
             #region 防止连击
466
             if (IsPressButton)
466
             if (IsPressButton)
467
             {
467
             {
468
-                new Thread(new ThreadStart(new Action(() =>
469
-                {
470
-                    Thread.Sleep(500);
471
-                    IsPressButton = false;
472
-                }))).Start();
473
                 return;
468
                 return;
474
             }
469
             }
475
             else
470
             else
476
             {
471
             {
477
                 IsPressButton = true;
472
                 IsPressButton = true;
473
+                new Thread(new ThreadStart(new Action(() =>
474
+                {
475
+                    Thread.Sleep(500);
476
+                    IsPressButton = false;
477
+                }))).Start();
478
             }
478
             }
479
             #endregion
479
             #endregion
480
             k_hook.Stop();
480
             k_hook.Stop();
486
             {
486
             {
487
                 if (APP.W_PracticeWindow.Visibility == Visibility.Visible)
487
                 if (APP.W_PracticeWindow.Visibility == Visibility.Visible)
488
                 {
488
                 {
489
+                    this.Owner = null;
489
                     APP.W_PracticeWindow.Hide();
490
                     APP.W_PracticeWindow.Hide();
490
                 }
491
                 }
491
             }
492
             }
499
             {
500
             {
500
                 APP.W_XHMicroLessonSystemWindow = new XHMicroLessonSystemWindow();
501
                 APP.W_XHMicroLessonSystemWindow = new XHMicroLessonSystemWindow();
501
             }
502
             }
503
+            APP.W_XHMicroLessonSystemWindow.InitializeKeyDownEvent();
502
             APP.W_XHMicroLessonSystemWindow.Show();
504
             APP.W_XHMicroLessonSystemWindow.Show();
503
             if (!IsFirstRS)
505
             if (!IsFirstRS)
504
             {
506
             {
601
                         borTwo.Background = new SolidColorBrush(Colors.DodgerBlue);
603
                         borTwo.Background = new SolidColorBrush(Colors.DodgerBlue);
602
                     });
604
                     });
603
                     flg = 1;
605
                     flg = 1;
606
+                    this.Owner = null;
604
                     APP.W_PracticeWindow.Hide();
607
                     APP.W_PracticeWindow.Hide();
605
                 }
608
                 }
606
                 else if (flg == 10)
609
                 else if (flg == 10)
640
                     flg = 11;
643
                     flg = 11;
641
                     APP.W_PracticeWindow.Blue();
644
                     APP.W_PracticeWindow.Blue();
642
                     APP.W_PracticeWindow.Show();
645
                     APP.W_PracticeWindow.Show();
646
+                    this.Owner = APP.W_PracticeWindow;
647
+                    this.Topmost = true;
643
                 }
648
                 }
644
             }
649
             }
645
             catch (Exception ex)
650
             catch (Exception ex)
883
                         borTwo.Background = new SolidColorBrush(Colors.DodgerBlue);
888
                         borTwo.Background = new SolidColorBrush(Colors.DodgerBlue);
884
                     });
889
                     });
885
                     flg = 0;
890
                     flg = 0;
891
+                    this.Owner = null;
886
                     APP.W_PracticeWindow.Hide();
892
                     APP.W_PracticeWindow.Hide();
887
                 }
893
                 }
888
                 else if (flg == 11)
894
                 else if (flg == 11)
918
                     flg = 10;
924
                     flg = 10;
919
                     APP.W_PracticeWindow.Red();
925
                     APP.W_PracticeWindow.Red();
920
                     APP.W_PracticeWindow.Show();
926
                     APP.W_PracticeWindow.Show();
927
+                    this.Owner = APP.W_PracticeWindow;
928
+                    this.Topmost = true;
921
                 }
929
                 }
922
             }
930
             }
923
             catch (Exception ex)
931
             catch (Exception ex)
934
         {
942
         {
935
             if (flg > 9)
943
             if (flg > 9)
936
             {
944
             {
945
+                this.Owner = null;
937
                 APP.W_PracticeWindow.Hide();
946
                 APP.W_PracticeWindow.Hide();
938
             }
947
             }
939
             else
948
             else
1044
                     LogHelper.WriteErrLog("【录屏返回】(BtnStopRecordingScreen_Click)" + ex.Message, ex);
1053
                     LogHelper.WriteErrLog("【录屏返回】(BtnStopRecordingScreen_Click)" + ex.Message, ex);
1045
                 }
1054
                 }
1046
             }
1055
             }
1056
+            APP.W_XHMicroLessonSystemWindow.InitializeKeyDownEvent();
1047
             APP.W_XHMicroLessonSystemWindow.Show();
1057
             APP.W_XHMicroLessonSystemWindow.Show();
1048
             Hide();
1058
             Hide();
1049
         }
1059
         }
1063
                 Thread.Sleep(500);
1073
                 Thread.Sleep(500);
1064
                 Dispatcher.Invoke(() =>
1074
                 Dispatcher.Invoke(() =>
1065
                 {
1075
                 {
1076
+                    this.Owner = null;
1066
                     APP.W_PracticeWindow.Hide();
1077
                     APP.W_PracticeWindow.Hide();
1067
                 });
1078
                 });
1068
             }))).Start();
1079
             }))).Start();

+ 20
- 20
XHWK.WKTool/XHMicroLessonSystemWindow.xaml View File

318
                              MouseWheel="IMG1_MouseWheel" >
318
                              MouseWheel="IMG1_MouseWheel" >
319
                                             </ContentControl>
319
                                             </ContentControl>
320
                                         </ScrollViewer>-->
320
                                         </ScrollViewer>-->
321
-                                        <!--图片表框 -->
322
-                                        <Rectangle x:Name="RectImgBorder" Cursor="SizeAll" Fill="#00000000" HorizontalAlignment="Left" Stroke="#2D8CF0" VerticalAlignment="Top" Width="300" Height="300" Visibility="Hidden" Margin="373,175,0,0" StrokeThickness="4" StrokeDashArray="4 4" SnapsToDevicePixels="True"/>
323
-                                        <Image Name="imgCanvas" Height="0" VerticalAlignment="Top" HorizontalAlignment="Left" Stretch="Fill" MouseDown="PicEMap_MouseDown" RenderTransform="{StaticResource Imageview}" MouseRightButtonDown="imgCanvas_MouseRightButtonDown" MouseLeftButtonDown="imgCanvas_MouseLeftButtonDown" Focusable="True" MouseMove="imgCanvas_MouseMove" MouseUp="imgCanvas_MouseUp"/>
324
-                                        <!--四个点 -->
325
-                                        <Canvas>
326
-                                            <Thumb x:Name="RectLeftUp" Cursor="SizeNWSE"  HorizontalAlignment="Left" Height="20"  VerticalAlignment="Top" Width="20" Visibility="Hidden" Canvas.Left="314" Canvas.Top="157" Background="White" BorderBrush="#2D8CF0" BorderThickness="2"  DragDelta="RectRightUp_DragDelta" DragStarted="RectRightUp_DragStarted" DragCompleted="RectRightUp_DragCompleted"/>
327
-                                            <Thumb x:Name="RectRightUp" Cursor="SizeNESW"  HorizontalAlignment="Left" Height="20"  VerticalAlignment="Top" Width="20" Visibility="Hidden" Canvas.Left="775" Canvas.Top="157" Background="White" BorderBrush="#2D8CF0" BorderThickness="2" DragDelta="RectRightUp_DragDelta" DragStarted="RectRightUp_DragStarted" DragCompleted="RectRightUp_DragCompleted"/>
328
-                                            <Thumb x:Name="RectLeftDown" Cursor="SizeNESW"  HorizontalAlignment="Left" Height="20"  VerticalAlignment="Top" Width="20" Visibility="Hidden" Canvas.Left="314" Canvas.Top="508" Background="White" BorderBrush="#2D8CF0" BorderThickness="2" DragDelta="RectRightUp_DragDelta" DragStarted="RectRightUp_DragStarted" DragCompleted="RectRightUp_DragCompleted"/>
329
-                                            <Thumb x:Name="RectRightDown" Cursor="SizeNWSE"  HorizontalAlignment="Left" Height="20"  VerticalAlignment="Top" Width="20" Visibility="Hidden" Canvas.Left="775" Canvas.Top="508" Background="White" BorderBrush="#2D8CF0" BorderThickness="2" DragDelta="RectRightUp_DragDelta" DragStarted="RectRightUp_DragStarted" DragCompleted="RectRightUp_DragCompleted"/>
330
-                                        </Canvas>
331
-                                    </Grid>
332
-                                </Border>
333
-                            </Grid>
334
-                            <Image x:Name="imgDocumentation" Visibility="Visible" VerticalAlignment="Top" Stretch="Fill"/>
335
-                            <Image x:Name="imgPPT" Visibility="Visible" VerticalAlignment="Top"/>
336
-                            <!--导入图片-->
337
-                            <!--<Button Cursor="Hand" x:Name="btnOk" Height="50" Width="50" Content="√" FontSize="26" Background="#2E8CF0" Foreground="#FFFFFF" Click="btnOk_Click" Visibility="Collapsed"/>-->
338
-                            <InkCanvas Grid.Row="0" x:Name="blackboard_canvas"  Background="Transparent" Visibility="Collapsed" Grid.ColumnSpan="2"/>
339
-                            <!--摄像头-->
340
-                            <!--<wfi:WindowsFormsHost Grid.Row="0" Grid.Column="1" x:Name="wfhCamera" Height="124" Width="172" HorizontalAlignment="Right" Margin="0,10,30.10,0" VerticalAlignment="Top">
321
+                                    <!--图片表框 -->
322
+                                    <Rectangle x:Name="RectImgBorder" Cursor="SizeAll" Fill="#00000000" HorizontalAlignment="Left" Stroke="#2D8CF0" VerticalAlignment="Top" Width="300" Height="300" Visibility="Hidden" Margin="373,175,0,0" StrokeThickness="4" StrokeDashArray="4 4" SnapsToDevicePixels="True"/>
323
+                                    <Image Name="imgCanvas" Height="0" VerticalAlignment="Top" HorizontalAlignment="Left" Stretch="Fill" MouseDown="PicEMap_MouseDown" RenderTransform="{StaticResource Imageview}" MouseLeftButtonDown="imgCanvas_MouseLeftButtonDown" Focusable="True" MouseMove="imgCanvas_MouseMove" MouseUp="imgCanvas_MouseUp"/>
324
+                                    <!--四个点 -->
325
+                                    <Canvas>
326
+                                        <Thumb x:Name="RectLeftUp" Cursor="SizeNWSE"  HorizontalAlignment="Left" Height="20"  VerticalAlignment="Top" Width="20" Visibility="Hidden" Canvas.Left="314" Canvas.Top="157" Background="White" BorderBrush="#2D8CF0" BorderThickness="2"  DragDelta="RectRightUp_DragDelta" DragStarted="RectRightUp_DragStarted" DragCompleted="RectRightUp_DragCompleted"/>
327
+                                        <Thumb x:Name="RectRightUp" Cursor="SizeNESW"  HorizontalAlignment="Left" Height="20"  VerticalAlignment="Top" Width="20" Visibility="Hidden" Canvas.Left="775" Canvas.Top="157" Background="White" BorderBrush="#2D8CF0" BorderThickness="2" DragDelta="RectRightUp_DragDelta" DragStarted="RectRightUp_DragStarted" DragCompleted="RectRightUp_DragCompleted"/>
328
+                                        <Thumb x:Name="RectLeftDown" Cursor="SizeNESW"  HorizontalAlignment="Left" Height="20"  VerticalAlignment="Top" Width="20" Visibility="Hidden" Canvas.Left="314" Canvas.Top="508" Background="White" BorderBrush="#2D8CF0" BorderThickness="2" DragDelta="RectRightUp_DragDelta" DragStarted="RectRightUp_DragStarted" DragCompleted="RectRightUp_DragCompleted"/>
329
+                                        <Thumb x:Name="RectRightDown" Cursor="SizeNWSE"  HorizontalAlignment="Left" Height="20"  VerticalAlignment="Top" Width="20" Visibility="Hidden" Canvas.Left="775" Canvas.Top="508" Background="White" BorderBrush="#2D8CF0" BorderThickness="2" DragDelta="RectRightUp_DragDelta" DragStarted="RectRightUp_DragStarted" DragCompleted="RectRightUp_DragCompleted"/>
330
+                                    </Canvas>
331
+                                </Grid>
332
+                            </Border>
333
+                        </Grid>
334
+                        <Image x:Name="imgDocumentation" Visibility="Visible" VerticalAlignment="Top" Stretch="Fill"/>
335
+                        <Image x:Name="imgPPT" Visibility="Visible" VerticalAlignment="Top"/>
336
+                        <!--导入图片-->
337
+                        <!--<Button Cursor="Hand" x:Name="btnOk" Height="50" Width="50" Content="√" FontSize="26" Background="#2E8CF0" Foreground="#FFFFFF" Click="btnOk_Click" Visibility="Collapsed"/>-->
338
+                        <InkCanvas Grid.Row="0" x:Name="blackboard_canvas"  Background="Transparent" Visibility="Collapsed" Grid.ColumnSpan="2"/>
339
+                        <!--摄像头-->
340
+                        <!--<wfi:WindowsFormsHost Grid.Row="0" Grid.Column="1" x:Name="wfhCamera" Height="124" Width="172" HorizontalAlignment="Right" Margin="0,10,30.10,0" VerticalAlignment="Top">
341
                     <aforge:VideoSourcePlayer x:Name="player" Height="124" Width="172"  />
341
                     <aforge:VideoSourcePlayer x:Name="player" Height="124" Width="172"  />
342
                 </wfi:WindowsFormsHost>-->
342
                 </wfi:WindowsFormsHost>-->
343
                             <!--<Image x:Name="imgLoad"
343
                             <!--<Image x:Name="imgLoad"

+ 36
- 20
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs View File

176
             txbStoragePath.Content = FileToolsCommon.GetConfigValue("VideoSavePath");
176
             txbStoragePath.Content = FileToolsCommon.GetConfigValue("VideoSavePath");
177
             Initialize();
177
             Initialize();
178
             InitPen();
178
             InitPen();
179
+            k_hook = new KeyboardHookCommon();
180
+            k_hook.KeyDownEvent += K_hook_KeyDownEvent;
179
         }
181
         }
180
         /// <summary>
182
         /// <summary>
181
         /// 初始化
183
         /// 初始化
207
             //wfhCamera.Visibility = Visibility.Hidden;
209
             //wfhCamera.Visibility = Visibility.Hidden;
208
             ImgPDFPath = null;
210
             ImgPDFPath = null;
209
             ImgPDFPath = new string[300];
211
             ImgPDFPath = new string[300];
210
-
212
+        } 
213
+        /// <summary>
214
+        /// 初始化快捷键
215
+        /// </summary>
216
+        public void InitializeKeyDownEvent() 
217
+        {
218
+            k_hook.Start();//安装键盘钩子
211
         }
219
         }
212
         /// <summary>
220
         /// <summary>
213
         /// 快捷键
221
         /// 快捷键
232
                     next_btn_Click(null, null);
240
                     next_btn_Click(null, null);
233
                 }
241
                 }
234
             }
242
             }
235
-            //if (e.KeyValue == (int)System.Windows.Forms.Keys.Delete)
236
-            //{
237
-            //    if (APP.pageData.currpage < APP.pageData.pagenum)
238
-            //    {
239
-            //        //下一页
240
-            //        next_btn_Click(null, null);
241
-            //    }
242
-            //}
243
+            if (e.KeyValue == (int)System.Windows.Forms.Keys.Delete)
244
+            {
245
+                if (RectImgBorder.Visibility != Visibility.Hidden)
246
+                {
247
+                    HideAngleBorder();
248
+                    imgCanvas.Source = null;
249
+                    APP.PageDrawList[APP.pageData.currpage - 1].PdfImagePath = null;
250
+                    APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath = null;
251
+                }
252
+            }
243
         }
253
         }
244
 
254
 
245
         /// <summary>
255
         /// <summary>
902
             string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) + time + ".jpg";
912
             string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) + time + ".jpg";
903
             APP.ImgPath = desktopPath;
913
             APP.ImgPath = desktopPath;
904
             ImageHelper.GetScreenshot(new System.Drawing.Rectangle(0, 0, 0, 0), desktopPath, false, out BitmapImage bitmap);
914
             ImageHelper.GetScreenshot(new System.Drawing.Rectangle(0, 0, 0, 0), desktopPath, false, out BitmapImage bitmap);
915
+            k_hook.Stop();
905
             if (WindowState == WindowState.Normal)//截图隐藏窗口
916
             if (WindowState == WindowState.Normal)//截图隐藏窗口
906
             {
917
             {
907
                 WindowState = WindowState.Minimized;
918
                 WindowState = WindowState.Minimized;
908
             }
919
             }
920
+       
909
             if (APP.W_JieTuWindow != null)
921
             if (APP.W_JieTuWindow != null)
910
             {
922
             {
911
                 APP.W_JieTuWindow.initialization();
923
                 APP.W_JieTuWindow.initialization();
912
                 APP.W_JieTuWindow.Screenshot();
924
                 APP.W_JieTuWindow.Screenshot();
925
+                APP.W_JieTuWindow.InitializeKeyDownEvent();
913
                 APP.W_JieTuWindow.WindowState = WindowState.Maximized;
926
                 APP.W_JieTuWindow.WindowState = WindowState.Maximized;
914
                 APP.W_JieTuWindow.Visibility = Visibility.Visible;
927
                 APP.W_JieTuWindow.Visibility = Visibility.Visible;
915
             }
928
             }
916
             else
929
             else
917
             {
930
             {
918
                 APP.W_JieTuWindow = new JieTuWindow();
931
                 APP.W_JieTuWindow = new JieTuWindow();
932
+                APP.W_JieTuWindow.InitializeKeyDownEvent();
919
                 // 订阅事件
933
                 // 订阅事件
920
                 APP.W_JieTuWindow.ChangeTextEvent += new ChangeTextHandler(frm_ChangeTextEvent);
934
                 APP.W_JieTuWindow.ChangeTextEvent += new ChangeTextHandler(frm_ChangeTextEvent);
921
                 APP.W_JieTuWindow.click_closeJietuWindowClick += JietuWindow_click_closeJietuWindowClick;
935
                 APP.W_JieTuWindow.click_closeJietuWindowClick += JietuWindow_click_closeJietuWindowClick;
937
                     Topmost = true;
951
                     Topmost = true;
938
                     WindowState = WindowState.Normal;
952
                     WindowState = WindowState.Normal;
939
                 }
953
                 }
954
+                InitializeKeyDownEvent();
940
                 if (!string.IsNullOrWhiteSpace(APP.ImgPath) && File.Exists(APP.ImgPath))
955
                 if (!string.IsNullOrWhiteSpace(APP.ImgPath) && File.Exists(APP.ImgPath))
941
                 {
956
                 {
942
                     if (APP.pageData.currpage == 0)
957
                     if (APP.pageData.currpage == 0)
2633
             //        return;
2648
             //        return;
2634
             //    }
2649
             //    }
2635
             //}
2650
             //}
2636
-            #endregion   
2651
+            #endregion
2652
+            k_hook.Stop();
2637
             if (APP.W_ScreenRecordingToolbarWindow == null)
2653
             if (APP.W_ScreenRecordingToolbarWindow == null)
2638
             {
2654
             {
2639
                 APP.W_ScreenRecordingToolbarWindow = new ScreenRecordingToolbarWindow
2655
                 APP.W_ScreenRecordingToolbarWindow = new ScreenRecordingToolbarWindow
2696
             #region 防止连击
2712
             #region 防止连击
2697
             if (IsPressButton)
2713
             if (IsPressButton)
2698
             {
2714
             {
2699
-                new Thread(new ThreadStart(new Action(() =>
2700
-                {
2701
-                    Thread.Sleep(500);
2702
-                    IsPressButton = false;
2703
-                }))).Start();
2704
                 return;
2715
                 return;
2705
             }
2716
             }
2706
             else
2717
             else
2707
             {
2718
             {
2708
                 IsPressButton = true;
2719
                 IsPressButton = true;
2720
+                new Thread(new ThreadStart(new Action(() =>
2721
+                {
2722
+                    Thread.Sleep(500);
2723
+                    IsPressButton = false;
2724
+                }))).Start();
2709
             }
2725
             }
2710
             #endregion
2726
             #endregion
2711
             Record();
2727
             Record();
2741
             #region 防止连击
2757
             #region 防止连击
2742
             if (IsPressButton)
2758
             if (IsPressButton)
2743
             {
2759
             {
2744
-                new Thread(new ThreadStart(new Action(() =>
2745
-                {
2746
-                    Thread.Sleep(500);
2747
-                    IsPressButton = false;
2748
-                }))).Start();
2749
                 return;
2760
                 return;
2750
             }
2761
             }
2751
             else
2762
             else
2752
             {
2763
             {
2753
                 IsPressButton = true;
2764
                 IsPressButton = true;
2765
+                new Thread(new ThreadStart(new Action(() =>
2766
+                {
2767
+                    Thread.Sleep(500);
2768
+                    IsPressButton = false;
2769
+                }))).Start();
2754
             }
2770
             }
2755
             #endregion
2771
             #endregion
2756
             blackboard_canvas.Visibility = Visibility.Collapsed;
2772
             blackboard_canvas.Visibility = Visibility.Collapsed;

Loading…
Cancel
Save