ToucDownBtn.cs
1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Permissions;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
class ToucDownBtn : System.Windows.Forms.Button
{
public const int WM_POINTERDOWN = 0x246;
public const int WM_POINTERUP = 0x247;
[PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
protected override void WndProc(ref Message m)
{
switch (m.Msg)
{
case WM_POINTERDOWN:
{
MouseEventArgs args = new MouseEventArgs(MouseButtons.Left, 1, 1, 1, 0);
OnMouseDown(args);
//Console.WriteLine("WM_POINTERDOWN");
break;
}
case WM_POINTERUP:
{
MouseEventArgs args = new MouseEventArgs(MouseButtons.Left, 1, 1, 1, 0);
OnMouseUp(args);
//Console.WriteLine("WM_POINTERUP");
break;
}
}
base.WndProc(ref m);
}
}