|
@@ -1,4 +1,5 @@
|
1
|
|
-using Common.system;
|
|
1
|
+using Aspose.Pdf.Text;
|
|
2
|
+using Common.system;
|
2
|
3
|
|
3
|
4
|
using System;
|
4
|
5
|
using System.Configuration;
|
|
@@ -62,6 +63,7 @@ namespace XHWK.WKTool
|
62
|
63
|
/// 🖊状态 0红色 1蓝色 10红色批注内 11蓝色批注内
|
63
|
64
|
/// </summary>
|
64
|
65
|
public int flg = 0;
|
|
66
|
+ System.Timers.Timer timer = new System.Timers.Timer();
|
65
|
67
|
#endregion
|
66
|
68
|
|
67
|
69
|
#region 初始化
|
|
@@ -77,6 +79,11 @@ namespace XHWK.WKTool
|
77
|
79
|
/// </summary>
|
78
|
80
|
public void Initialize()
|
79
|
81
|
{
|
|
82
|
+ //timer = new System.Timers.Timer(200);
|
|
83
|
+ //timer.Interval = 300;
|
|
84
|
+ //timer.Elapsed += new System.Timers.ElapsedEventHandler(TimerDealy);
|
|
85
|
+ //timer.Enabled = true; //启动计时器
|
|
86
|
+
|
80
|
87
|
k_hook = new KeyboardHookCommon();
|
81
|
88
|
k_hook.KeyDownEvent += K_hook_KeyDownEvent;
|
82
|
89
|
|
|
@@ -115,7 +122,32 @@ namespace XHWK.WKTool
|
115
|
122
|
//ImgRecordingScreen.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar25.png"));
|
116
|
123
|
//BtnRecordingScreen_Click(null, null);
|
117
|
124
|
}
|
|
125
|
+ void TimerDealy(object o, EventArgs e)
|
|
126
|
+ {
|
|
127
|
+ Dispatcher.Invoke(() =>
|
|
128
|
+ {
|
|
129
|
+ if (this.Left > 1630)
|
|
130
|
+ {
|
|
131
|
+ return;
|
|
132
|
+ }
|
|
133
|
+ //获取鼠标在屏幕上的位置
|
|
134
|
+ double mouse_x = Form.MousePosition.X; //需要添加引用System.Drawing
|
|
135
|
+ double mouse_y = Form.MousePosition.Y;
|
|
136
|
+
|
|
137
|
+ bool is_in_collasped_range = (mouse_y > this.Left + this.Height) || (mouse_x < this.Left || mouse_x > this.Left + this.Width);//缩起的条件
|
|
138
|
+ bool is_in_visiable_range = (mouse_y < 1 && mouse_x >= this.Left && mouse_x <= this.Left + this.Width); //展开的条件
|
118
|
139
|
|
|
140
|
+ if (this.Left < 1630 && this.Left >= 0 && is_in_collasped_range)
|
|
141
|
+ {
|
|
142
|
+ System.Threading.Thread.Sleep(300);
|
|
143
|
+ this.Left +=20 /*-this.ActualWidth - 3*/;
|
|
144
|
+ }
|
|
145
|
+ else if (this.Left < 0 && is_in_visiable_range)
|
|
146
|
+ {
|
|
147
|
+ this.Left = 1;
|
|
148
|
+ }
|
|
149
|
+ });
|
|
150
|
+ }
|
119
|
151
|
private void K_hook_KeyDownEvent(object sender, System.Windows.Forms.KeyEventArgs e)
|
120
|
152
|
{
|
121
|
153
|
if (e.KeyValue == (int)System.Windows.Forms.Keys.F5 && (int)Control.ModifierKeys == (int)Keys.Control)
|